mk90.basic.statements

Statement IF

Select a numbered destination or a structured block.

Syntax

IF expression THEN line-number
IF expression THEN
  statements
[ELSE
  statements]
ENDIF

Parameters

ParameterMeaning
expressionZero is false; every nonzero value is true.

Behavior

The numbered form remains compatible with earlier listings. The multiline form nests with loops and other IF blocks. THEN ends the header line; ELSE and ENDIF occupy separate lines. The compiler validates matching delimiters before publishing the executable.

Example

A=2
IF A THEN
PRINT "TRUE"
ELSE
PRINT "FALSE"
ENDIF

Limits and diagnostics

No inline THEN statement, ELSEIF, END IF spelling or implicit closing at EOF.

Status-code reference.

See also

ELSE · ENDIF · WHILE · Language syntax