|
-
Sep 29th, 2002, 10:00 PM
#1
Thread Starter
Fanatic Member
Easy Select Case question
Ok, I haven't used this in awhile so I just need a little refreshing. How can I do the following?
VB Code:
Select Case txtPieces.text
Case is between 1 and 199
'do something
Case is between 200 and 400
'Do something else
etc.........
End Select
any help appreciated.
-
Sep 29th, 2002, 10:04 PM
#2
Addicted Member
select case takes the first case that applies, processes it, and goes to end select, so you can do
VB Code:
Select Case yourvariable
Case Is > 600
'do thingy
Case Is > 400
'do another thingy
Case Is > 200
'do yet another thingy
Case is > 0
'do something else
End Select
hope it helps
-
Sep 29th, 2002, 10:05 PM
#3
i think you can do this also
select case var
case 1 to 100
and i KNOW you can separate them with commas
case 1, 2, 3
-
Sep 29th, 2002, 10:06 PM
#4
Addicted Member
using commas from 1 to 199 will be annoying to program though
-
Sep 29th, 2002, 10:09 PM
#5
Addicted Member
I quickly checked, and
case x to y
does work
-
Sep 29th, 2002, 10:29 PM
#6
Fanatic Member
Case 500 to System.Int32.MaxValue is handy to be aware of too.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|