guides:programming:programmers_reference_manual:multi_line_if

Multi-line If statement

If test Then

  statements

End Else

  statements

End

The multi-line If statement has the following parameters.

ParameterDescription
testAn expression that equates to a Boolean value ¾ true or false. False is 0 or null. True is any other value.
statementsAny valid BASIC+ statement. May include branching instructions, such as GoTo or GoSub.
Then or ElseWhen 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.
EndUse 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.
  • guides/programming/programmers_reference_manual/multi_line_if.txt
  • Last modified: 2024/06/19 20:20
  • by 127.0.0.1