|
 |
asp_web_howto thread: RE: AND/OR logic with IF THEN statements
Message #1 by "Chris Thompson" <cthompson@n...> on Mon, 10 Jun 2002 08:35:49 -0600
|
|
IF intNum =3D 2 AND intNum > 99 THEN
'Execute because both conditions were met
'(not that these 2 conditions will ever be met)
End If
Chris
-----Original Message-----
From: Tim Morgan [mailto:EastCoastPilot@H...]
Sent: Sunday, June 09, 2002 8:46 AM
To: ASP Web HowTo
Subject: [asp_web_howto] AND/OR logic with IF THEN statements
Does anyone know the syntax for a IF-THEN statement that contains an OR
clause where two conditions must be met in order for the THEN portion to
execute?
I'm thinking it would be something like:
IF intNum =3D 2 OR intNum > 99 THEN
Also, what's the syntax for an AND condition? I've been using nested
IF-
THEN statements like:
IF intNum =3D 2 Then
IF intNum > 99 Then
'code to execute if both are true.
I image there a way to combine that into one IF-THEN statement.
Tim
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
r-20
Message #2 by "Tim Morgan" <EastCoastPilot@H...> on Sun, 9 Jun 2002 14:46:05
|
|
Does anyone know the syntax for a IF-THEN statement that contains an OR
clause where two conditions must be met in order for the THEN portion to
execute?
I'm thinking it would be something like:
IF intNum = 2 OR intNum > 99 THEN
Also, what's the syntax for an AND condition? I've been using nested IF-
THEN statements like:
IF intNum = 2 Then
IF intNum > 99 Then
'code to execute if both are true.
I image there a way to combine that into one IF-THEN statement.
Tim
Message #3 by "TomMallard" <mallard@s...> on Sun, 9 Jun 2002 06:51:38 -0700
|
|
Use paren's to isolate OR clauses to work as a single condition...
IF (intNum = 2 OR intNum > 99) AND (some other condition) THEN
HTH,
tom mallard
seattle
-----Original Message-----
From: Tim Morgan [mailto:EastCoastPilot@H...]
Sent: Sunday, June 09, 2002 2:46 PM
To: ASP Web HowTo
Subject: [asp_web_howto] AND/OR logic with IF THEN statements
Does anyone know the syntax for a IF-THEN statement that contains an OR
clause where two conditions must be met in order for the THEN portion to
execute?
I'm thinking it would be something like:
IF intNum = 2 OR intNum > 99 THEN
Also, what's the syntax for an AND condition? I've been using nested IF-
THEN statements like:
IF intNum = 2 Then
IF intNum > 99 Then
'code to execute if both are true.
I image there a way to combine that into one IF-THEN statement.
Tim
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20
|
|
 |