Multi-line If statement
Syntax
If test Then
statements
End Else
statements
End
Parameters
The multi-line If statement has the following parameters.
Parameter | Description |
---|---|
test | An expression that equates to a Boolean value ¾ true or false. False is 0 or null. True is any other value. |
statements | Any valid BASIC+ statement. May include branching instructions, such as GoTo or GoSub. |
Then or Else | When Then or Else is the last keyword on a line, BASIC+ assumes that multiple lines follow. The Else clause is optional. One or more statements may appear in the Then or Else clauses. They may be written on the same line, if separated by semicolons. |
End | Use End to terminate the multi-lined Then statements and the multi-lined Else statements. Should you fail to include the End statement to indicate the end of the Then or Else logic, the program will not compile, or, it will use the next available End statement as the termination of your Then or Else logic, rendering unpredictable results. |