EasyManua.ls Logo

CipherLab 8 Series - Page 45

CipherLab 8 Series
263 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
33
Chapter 4 BASIC Commands
IF THEN [ELSE…]
Purpose To provide a decision structure for single-line conditional execution.
Syntax IF condition THEN action1 [ELSE action2]
Remarks conditionis a logical expression.
actionis a BASIC statement.
Example
IF Data1% > Data2% THEN
Temp% = Data1%
ELSE
Temp% = Data2%
IF THEN {ELSE IF} [ELSE] END IF
Purpose To provide a decision structure for multiple-line conditional execution.
Syntax IF condition1 THEN
Statementblock1
{ELSE IF condition2 THEN
Statementblock2}
[ELSE
StatementblockN]
END IF
Remarks conditionis a logical expression.
Statementblockcan 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

Table of Contents

Related product manuals