If Condition Then ...
If the Condition (Boolean Expression) is true then the
statement after the THEN is executed. If the Condition
is false, the execution continues on the next line.
And & Or
Compound Conditions can be created using the And & Or Operators.
A = 5
In this Condition two values are being compared. Since an And is used, both Conditions must be true for "Hello" to be printed.
A = 5
Here, with an OR, two values are also being compared. Since an Or is used, either the first Condition or the second Condition or both must be true for "Hello" to be printed.
If a condition is just a numeric expression with no comparison operators, as in:
A = 0
The condition is false if the expression is zero. In the example above A = 0, so "Hello" will not be printed. Any non-zero value will be considered true.
A THEN may not be followed by a GOTO, FOR, NEXT or another IF.
Intuitively, a Not operator returns true when a condition is false, and false when a condition is true.
If Not isFile("Test.txt") Then Gosub CreateFile
The second form is the compound If...Then...Endif structure. It can be written as follows.