-
Couldn't load subscription status.
- Fork 0
Andrew Owen edited this page May 30, 2023
·
2 revisions
IF truth_value {THEN|GOTO} [compound_statement_true|line_number_true [anything]][ELSE [compound_statement_false|line_number_false [anything]]]
If truth_value is non-zero, executes compound_statement_true or jumps to
line_number_true. If it is zero, executes compound_statement_false or jumps to
line_number_false.
-
truth_valueis a numeric expression. -
line_number_falseandline_number_trueare existing line numbers. -
compound_statement_falseandcompound_statement_trueare compound statements, consisting of at least one statement, optionally followed by further statements separated by colons (:). The compound statements may contain nestedIFtoTHENtoELSEstatements.
- The comma is optional and ignored.
-
ELSEclauses are optional; they are bound to the innermost freeIFstatement if nested. AdditionalELSEclauses that have no matchingIFare ignored. - All clauses must be on the same program line.
-
THENandGOTOare interchangeable; which one is chosen is independent of whether a statement or a line number is given.GOTO PRINT 1` is fine. - As in
GOTO, anything after the line number is ignored.
- If
truth_valuehas a string value: Type mismatch. -
truth_valueequals0andline_number_falseis a non-existing line number, ortruth_valueis nonzero andline_number_trueis a non-existing line number: Undefined line number.
- Press
RETURNto return to this menu. - Enter the name of a
TOPICto display it. - Enter
EXITto return to BASIC.
Choose from the following topics: