PDA

Click to See Complete Forum and Search --> : select case driving me nutty


pnj
Dec 28th, 2000, 01:25 PM
I am trying to use a select case in an ASP page and am having problems.

here is what I am trying to do

select case bh.fullversion
case 3
Response.Write "browser is old and junky, you get the dumbed down version of our otherwise kickass site"
case 4
Response.Write "you got a good enough browser so now we check other things.....hang on..."
case else
Response.Write "Bummer"
end select


If I try and put in something like this..

case < 4

I get an error from the less than sign.

I need to say something like

if < 4 and (something else) then
do something.

I would like to use select case statment but can't seem to get it to work.
basicly I can't get it to accept the greater than or less then sign.

any help???
thanks

Cander
Dec 28th, 2000, 01:30 PM
Try saying

case 1 To 3

instead of
Case < 4

pnj
Dec 28th, 2000, 01:49 PM
I get an error now from the word 'to'.....

what I am checking is browser versions so I need to say if the version is 3 or 3.3 or 2.4 or 2.1 ect....

I think I will just need to use a if statment....
oh well.....

BruceG
Dec 28th, 2000, 01:52 PM
In a Select Case statement, if you want your Case to test for something other than equal, you have to use the word Is:

Case Is < 4
....

I don't know why you are getting an error on "To". Syntax like "Case 1 To 3" should work.

pnj
Dec 28th, 2000, 03:48 PM
I get a microsoft VBscript compilation error '800a03ea'

when I use the 'is' word.

oh well, like I said I am just gonna use an standard if statement.