
PT-Basic Programming Manual Ver. 1.00 18/143
3.2 Commands for decision structures
IF … THEN … {ELSE IF…} [ELSE…] END IF
To provide a decision structure for multiple-line conditional
execution.
IF condition1 THEN [statements1] {ELSE IF condition2
THEN statements2} [ELSE elsestatements] END IF
PRINT "Input a number:"
Result%=INPUT("",K%)
IF K% < 10 THEN
PRINT "One digit"
ELSE IF K% < 100 THEN
PRINT "Two digits"
ELSE
PRINT "Over one Hundry!"
END IF
condition is a logical expression.
statements can be multiple lines of BASIC statements.
Commenti su questo manuale