multiple contitions for select case
hi,
id like to know how, if it is possible, to check for multiple conditions in a VB/VBScript select case statement.
eg
select SomeThing AND AnotherThing
case SomeThing=1 AND AnotherThing=2
blah
case SomeThing=3 AND AnotherThing=7
blah
end select
etc.
im trying to avoid using excessive if statements to do this. select is easier to understand . ive tried variations of the above psuedo but to no avail. any help is appreciated.
thanks
Peter J. Boettcher posted this at 06:29 — 20th October 2001.
They have: 812 posts
Joined: Feb 2000
I don't think that's possible, you could try nesting your Select statements like:
Select Case SomeThing
Case 1
Select Case AnotherThing
Case 2
'some code
End Select
Case 3
Select Case AnotherThing
Case 7
'some code
End Select
End Select
PJ | Are we there yet?
pjboettcher.com
Mark Hensler posted this at 09:14 — 20th October 2001.
He has: 4,048 posts
Joined: Aug 2000
That's one of the things I never liked about VB.
With C style langues, you can do stuff like this:
switch case ($var) {
case 1:
case 2:
# do foo
break;
default:
# do bar
break;
}
Mark Hensler
If there is no answer on Google, then there is no question.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.