Shop OBEX P1 Docs P2 Docs Learn Events
If statement with two conditions? — Parallax Forums

If statement with two conditions?

wicklewickle Posts: 6
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

  • stamptrolstamptrol Posts: 1,731
    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.