Forum Moderators: open

Message Too Old, No Replies

Construct an if statement with multiple "or's"

Simple, but difficult for me

         

ukgimp

2:32 pm on Aug 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello

I am try to do an if statement but have two or three options that can individually or singlarly trigger the if.

If isnumeric(my_number) or isnumeric(my_number 2) then Do something

What is the correct construction, this is proving hard to find.

Cheers

aspdaddy

2:42 pm on Aug 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Bracket each condition individually, and then the whole statement.

If ((isnumeric(my_number)) or
(isnumeric(my_number 2))) then

RossWal

4:38 pm on Aug 4, 2003 (gmt 0)

10+ Year Member



When If statements get confusing, I like to substiitute Select Case:


Select Case True
Case isNumeric(a), b < C
Call CalcIt(a,b)
Case d > b
Call Calc it(c,d)
Case Else
Response.Write("Oh Shucks")
End Select

Ross

Sorry, don't know why indentations didn't stick.....

ukgimp

6:45 pm on Aug 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks both, i have it now, i knew it was simple. Been away from ASP for some time :)