Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VB equivalent to foxpro's IIF
Message
From
22/06/2000 12:45:09
 
 
To
21/06/2000 09:16:44
General information
Forum:
Visual Basic
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00379914
Message ID:
00383247
Views:
17
>The equivalent of VFP's DO CASE...ENDCASE in VB is Select Case:
>
>
Select Case Number   ' Evaluate Number.
>Case 1 To 5   ' Number between 1 and 5, inclusive.
>   Debug.Print "Between 1 and 5"
>Case 6, 7, 8   ' Number between 6 and 8.
>   Debug.Print "Between 6 and 8"
>Case 9 To 10   ' Number is 9 or 10.
>   Debug.Print "Greater than 8"
>Case Else   ' Other values.
>   Debug.Print "Not between 1 and 10"
>End Select
HTH
>Any better alternative in VB? In VFP, it's Do Case..Endcase.

Just one HUGE difference; Salect Case tests the value of exactly one item specified as an arguemnt in the Select Case line; unlike VFP, where each CASE can have it's own distinct evaluation expression.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform