Select Case and Case 0 To 9
Hmm.
I tried the first one but got nowhere [Syntax Error] although yours has a space between the < and the number. I'll try
it again.
I also tried the second one but my fingers got tired at about 13 or so and I gave up.
Thanks.
Chris.
Confirmed
You could do something like this if you like.
Select Case True
Case plngCallID < 10
response.write "0-9"
Case plngCallID < 20
response.write "10-19"
Case plngCallID < 30
response.write "20-29"
Case Else
response.write "Else"
End Select
Or if you want to be more exact, you can do plngCallID >=0 And plngCallID <
10 or whatever.
Or, you could do "Case 0,1,2,3,4,5,6,7,8,9", "Case
10,11,12,13,14,15,16,17,18,19" ...
Ray at work
Quote:
> Can anyone confirm if VBScript Select Case supports the N To N statement
as below?
> I seem to be getting Syntax Error on the:
> Case 0 to 9
> but can't find a conclusive yes or no on the support for the Case
statement at the moment in Google.
Quote:
> The value as read from a session variable is a string "7" but I'm pretty
sure it should coerce it to a numeric. Even so,
Quote:
> adding the explicit:
> plngCallID = CLng(plngCallID)
> hasn't helped a jot.
> Select Case plngCallID
> Case 0 To 9
> pstrRedirect = "requirements\browser_check.asp"
> Case 10 To 19
> pstrRedirect = "service\arcims_init.asp"
> Case 20 To 29
> 'Get a simple map image.
> pstrRedirect = "service\arcims_image_request.asp"
> Case Else
> plngCallID = 0
> pstrReturnValue = vbNullString
> End Select
> Cheers,
> Chris.