Results 1 to 5 of 5

Thread: select case driving me nutty

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2000
    Posts
    537
    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
    pnj

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913

    re:

    Try saying

    case 1 To 3

    instead of
    Case < 4

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2000
    Posts
    537
    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.....
    pnj

  4. #4
    PowerPoster BruceG's Avatar
    Join Date
    May 2000
    Location
    New Jersey (USA)
    Posts
    2,657
    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.
    "It's cold gin time again ..."

    Check out my website here.

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2000
    Posts
    537
    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.

    pnj

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width