Forum Moderators: open

Message Too Old, No Replies

If this is either that, that, or that, then do this

         

arretx

4:04 pm on May 17, 2005 (gmt 0)



I have code that checks to see if a user is a guest on the site. If they are, they don't see certain aspects of the site.

If left(szloginname,5) = 'GUEST' then <do code>
else <do nothing>
end if

How do I check for multiple values without nesting multiple if then statements?

if left(szloginname,5) = 'GUEST' or 'This Guy' or 'This guy' then <do code>
elseif left(szloginname,5) = 'this guy' then <do this instead>
end if

Easy_Coder

4:36 pm on May 17, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Have you tried casing it out...


select case left(szloginname,5)
case "GUEST", "This Guy", "This guy":
'do something
case "this guy"
'do something
case else
'do something as a default...
end select