VBScript Select Case vs VB Select Case
Quote:
> Hi there,
> I'm stuck with a simple select case statement in vbscript
> (ASP). The situation is like this :
> SELECT CASE iNumber
[...]
> CASE 4 to 90 : 'this doesn't work (does in VB, not ASP)
> CASE Is < 152 : 'doesn't work in ASP, does work in VB
You are, indeed, correct. To be precise, however, ASP is irrelevant -
the syntax does not work in VBScript, period. For future reference this,
and other differences, are listed at
<http://msdn.microsoft.com/library/en-us/script56/html/vsgrpnonfeature...>.
There is not a direct replacement for the syntax, but you can use a
useful kludge courtesy of Michael Harris:
Select Case True
...
Case iNumber >= 4 And iNumber <= 90
'Do stuff
Case iNumber < 152
'Do other stuff
End Select
hth
Adam
--
Linux: The OS people choose without $200,000,000 of persuasion.
-- Mike Coleman