From QB64 Wiki
- IF condition AND condition2
- If condition AND condition2 are True then the evaluation returns True.
- condition and condition2 can also contain their own AND evaluations.
- Both the IF evaluation and the AND evaluation must be True for the statement to be True.
- Statements can use parenthesis to clarify an evaluation.
- AND and OR cannot be used to combine command line operations.
- A double AND syntax error may be ignored and create a QB64 compiler error!
- Not to be confused with the AND and OR numerical operations.
|<||Less than||IF a < b THEN|
|>||Greater than||IF a > b THEN|
|=||Equal||IF a = b THEN|
|<=||Less than or equal||IF a <= b THEN|
|>=||Greater than or equal||IF a >= b THEN|
|<>||NOT equal||IF a <> b THEN|
Example: Using AND in an IF statement.
Explanation: Both condition evaluations must be true for the code to be executed.
Example: Using a AND a more complex way.
Explanation: The evaluations in the paranteses are evaluated first then the evaluation of the paranteses takes place, since all evaluations return True the IF...THEN evaluation returns True. If any of the evaluations returned False then the IF...THEN evaluation would also return False.