...

View Full Version : How to say "or" in asp script...



isaaclloyd
08-23-2005, 11:51 PM
I know it's a really silly question, but I can't find out how to say "or" like this:




If MyValue = "value1" AND MyName = "Bob" OR "James" Then
bla bla...
Else
bla bla...
END IF



Any comments would be appreciated. Thanks.


~Isaac~

jaywhy13
08-24-2005, 12:14 AM
Just try to keep in mind that the format is
if <<condition>> then
<<operations>>
end if

So to add conditions you do like so...
if <<condition>> OR <<condition>> AND <<condition>> then
<<operations>>
end if
and so on...

So you'd have to do...
If MyValue = "value1" AND (MyName = "Bob" OR MyName = "James") Then

Notice the bracketing... You'll have to bracket if you want to do what you were just sayin...
Reference:
http://www.w3schools.com/asp



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum