
{ELSE IF condition2 THEN
Statementblock2}
[ELSE
StatementblockN]
END IF
Remarks
“condition” is a logical expression.
“Statementblock” can be multiple lines of BASIC statements.
Example
IF LEFT$(String1$,1) = “A” THEN
PRINT “String1 is led by A.”
ELSE IF LEFT$(String1$,1) = “B” THEN
PRINT “String1 is led by B.”
ELSE
PRINT “String1 is not led by A nor B.”
END IF
IF … THEN … END IF
Purpose
To provide a decision structure for a conditional execution with multiple lines of
actions.
Syntax
IF condition1 THEN
action1
action2
…
END IF
Remarks
“condition” is a logical expression.
“action” is a BASIC statement.
Example
IF Data1% > Large% THEN
BEEP(800,30)
Large% = Data1%
PRINT “Current Largest Number is “, Data1%
END IF
ON ... GOSUB ...
Purpose
To call one of the several specified subroutines depending on the value of the
expression.
Comentarios a estos manuales