Shop
OBEX
P1 Docs
P2 Docs
Learn
Events
If statement with two conditions? — Parallax Forums
toggle menu
Categories
Discussions
Sign In
·
Register
Sign In
·
Register
Categories
Discussions
Sign In
·
Register
×
Home
›
BASIC Stamp
If statement with two conditions?
wickle
Posts:
6
2013-08-16 01:32
edited 2013-08-16 04:20
in
BASIC Stamp
Currently using an if statement but it would greatly help the stability of my program if i had two conditions in the if statement. Using stamp how do i add two conditions in one if statement?
Comments
stamptrol
Posts:
1,731
2013-08-16 04:20
edited 2013-08-16 04:20
Here's a sample with two conditions from the Editor Help file:
Main:
' Change AND to OR and see what happens
IF (value1 = 5) AND (value2 = 10) THEN Is_True
DEBUG "Statement was false."
END
There are other possibilities with the IF....THEN......ELSE structure and with the SELECT....CASE structure. They all have examples in the Help file.
Cheers,
Sign In
or
Register
to comment.
Comments
Main:
' Change AND to OR and see what happens
IF (value1 = 5) AND (value2 = 10) THEN Is_True
DEBUG "Statement was false."
END
There are other possibilities with the IF....THEN......ELSE structure and with the SELECT....CASE structure. They all have examples in the Help file.
Cheers,