473,385 Members | 2,004 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

VB6/VB.NET Case Is < 0 - in c# how?

Hi there. I need some help here.

I am trying to convert a sample application for learning
purposes. But i am stuck to see this:

Select Case ShipPitchSM
Case Is > 0
ShipPitchSM = ShipPitchSM -
Friction
If ShipPitchSM < 0 Then
ShipPitchSM = 0
If ShipPitchSM > 0.03 Then
ShipPitchSM = 0.03
Case Is < 0
ShipPitchSM = ShipPitchSM
+ Friction
If ShipPitchSM > 0 Then
ShipPitchSM = 0
If ShipPitchSM < -0.03
Then ShipPitchSM = -0.03
End Select

Select Case ShipYawSM
Case Is > 0
ShipYawSM = ShipYawSM -
Friction
If ShipYawSM < 0 Then
ShipYawSM = 0
If ShipYawSM > 0.03 Then
ShipYawSM = 0.03
Case Is < 0
ShipYawSM = ShipYawSM +
Friction
If ShipYawSM > 0 Then
ShipYawSM = 0
If ShipYawSM < -0.03 Then
ShipYawSM = -0.03
End Select

Select Case ShipRollSM
Case Is > 0
ShipRollSM = ShipRollSM -
Friction
If ShipRollSM < 0 Then
ShipRollSM = 0
If ShipRollSM > 0.03 Then
ShipRollSM = 0.03
Case Is < 0
ShipRollSM = ShipRollSM +
Friction
If ShipRollSM > 0 Then
ShipRollSM = 0
If ShipRollSM < -0.03 Then
ShipRollSM = -0.03
End Select

Any help?

How do you code that in c#? I try my best to place
conditions in case statements, but compile errors.

Thanks.

Regards,
Chua Wen Ching :p
Nov 15 '05 #1
4 10550
Chua Wen Ching,
C# does not allow conditions in its switch statement, you will need to
convert the Select Case into normal if then else statements.

http://msdn.microsoft.com/library/de...spec_8_7_2.asp

Hope this helps
Jay
"Chua Wen Ching" <cw*@cwc.com> wrote in message
news:02****************************@phx.gbl...
Hi there. I need some help here.

I am trying to convert a sample application for learning
purposes. But i am stuck to see this:

Select Case ShipPitchSM
Case Is > 0
ShipPitchSM = ShipPitchSM -
Friction
If ShipPitchSM < 0 Then
ShipPitchSM = 0
If ShipPitchSM > 0.03 Then
ShipPitchSM = 0.03
Case Is < 0
ShipPitchSM = ShipPitchSM
+ Friction
If ShipPitchSM > 0 Then
ShipPitchSM = 0
If ShipPitchSM < -0.03
Then ShipPitchSM = -0.03
End Select

Select Case ShipYawSM
Case Is > 0
ShipYawSM = ShipYawSM -
Friction
If ShipYawSM < 0 Then
ShipYawSM = 0
If ShipYawSM > 0.03 Then
ShipYawSM = 0.03
Case Is < 0
ShipYawSM = ShipYawSM +
Friction
If ShipYawSM > 0 Then
ShipYawSM = 0
If ShipYawSM < -0.03 Then
ShipYawSM = -0.03
End Select

Select Case ShipRollSM
Case Is > 0
ShipRollSM = ShipRollSM -
Friction
If ShipRollSM < 0 Then
ShipRollSM = 0
If ShipRollSM > 0.03 Then
ShipRollSM = 0.03
Case Is < 0
ShipRollSM = ShipRollSM +
Friction
If ShipRollSM > 0 Then
ShipRollSM = 0
If ShipRollSM < -0.03 Then
ShipRollSM = -0.03
End Select

Any help?

How do you code that in c#? I try my best to place
conditions in case statements, but compile errors.

Thanks.

Regards,
Chua Wen Ching :p

Nov 15 '05 #2
Chua Wen Ching,
C# does not allow conditions in its switch statement, you will need to
convert the Select Case into normal if then else statements.

http://msdn.microsoft.com/library/de...spec_8_7_2.asp

Hope this helps
Jay
"Chua Wen Ching" <cw*@cwc.com> wrote in message
news:02****************************@phx.gbl...
Hi there. I need some help here.

I am trying to convert a sample application for learning
purposes. But i am stuck to see this:

Select Case ShipPitchSM
Case Is > 0
ShipPitchSM = ShipPitchSM -
Friction
If ShipPitchSM < 0 Then
ShipPitchSM = 0
If ShipPitchSM > 0.03 Then
ShipPitchSM = 0.03
Case Is < 0
ShipPitchSM = ShipPitchSM
+ Friction
If ShipPitchSM > 0 Then
ShipPitchSM = 0
If ShipPitchSM < -0.03
Then ShipPitchSM = -0.03
End Select

Select Case ShipYawSM
Case Is > 0
ShipYawSM = ShipYawSM -
Friction
If ShipYawSM < 0 Then
ShipYawSM = 0
If ShipYawSM > 0.03 Then
ShipYawSM = 0.03
Case Is < 0
ShipYawSM = ShipYawSM +
Friction
If ShipYawSM > 0 Then
ShipYawSM = 0
If ShipYawSM < -0.03 Then
ShipYawSM = -0.03
End Select

Select Case ShipRollSM
Case Is > 0
ShipRollSM = ShipRollSM -
Friction
If ShipRollSM < 0 Then
ShipRollSM = 0
If ShipRollSM > 0.03 Then
ShipRollSM = 0.03
Case Is < 0
ShipRollSM = ShipRollSM +
Friction
If ShipRollSM > 0 Then
ShipRollSM = 0
If ShipRollSM < -0.03 Then
ShipRollSM = -0.03
End Select

Any help?

How do you code that in c#? I try my best to place
conditions in case statements, but compile errors.

Thanks.

Regards,
Chua Wen Ching :p

Nov 15 '05 #3
Thanks.

Regards,
Chua Wen Ching :p
Nov 15 '05 #4
Thanks.

Regards,
Chua Wen Ching :p
Nov 15 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Gabriel Harrison | last post by:
Hi, I know from the MySQL documentation that Windows in not case sensitive and Unix is but can I force Windows to honour upper and lower case in table names. When writing the mySQL on windows...
1
by: Christian Schmidbauer | last post by:
Hello! I prepare my XML document like this way: ------------------------------------------------------- PrintWriter writer; Document domDocument; Element domElement; // Root tag
2
by: Donald Firesmith | last post by:
I am having trouble having Google Adsense code stored in XSL converted properly into HTML. The <> unfortunately become &lt; and &gt; and then no longer work. XSL code is: <script...
4
by: higabe | last post by:
Three questions 1) I have a string function that works perfectly but according to W3C.org web site is syntactically flawed because it contains the characters </ in sequence. So how am I...
11
by: Les Paul | last post by:
I'm trying to design an HTML page that can edit itself. In essence, it's just like a Wiki page, but my own very simple version. It's a page full of plain old HTML content, and then at the bottom,...
7
by: C# newbie | last post by:
Hi, How can I make my query to return both "Bob" & "bob" (during search for a string) ? any idea? thanks
0
by: Chua Wen Ching | last post by:
Hi there. I need some help here. I am trying to convert a sample application for learning purposes. But i am stuck to see this: Select Case ShipPitchSM Case Is > 0 ShipPitchSM = ShipPitchSM...
9
by: Eric Lindsay | last post by:
I can't figure how to best display little snippets of shell script using <pre>. I just got around to organising to bulk validate some of my web pages, and one of the problems occurs with Bash...
21
by: markpapadakis | last post by:
I was checking out the C-FAQ and read here ( http://c-faq.com/misc/nonconstcase.html ) that: " case labels are limited to single, constant, integral expression ". However, I have been using...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.