02.10.2012 Views

Programmer's Reference Manual Intermec Fingerprint® v8.70.0 ...

Programmer's Reference Manual Intermec Fingerprint® v8.70.0 ...

Programmer's Reference Manual Intermec Fingerprint® v8.70.0 ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

IF...THEN...(ELSE)<br />

Chapter —Program Instructions<br />

Purpose Statement for conditional execution controlled by the result of a numeric<br />

expression.<br />

Syntax IF[,]THEN[ELSE]<br />

IF[,]THEN ↵<br />

↵<br />

[...] ↵<br />

[ELSE ↵<br />

↵<br />

[...]] ↵<br />

ENDIF ↵<br />

is a numeric expression, which is either true or false.<br />

is the statement or list of statements telling the program what to<br />

do, should the IF-condition be true.<br />

is an optional statement or list of statements specifying what will<br />

happen, should the IF-condition be false.<br />

Remarks THEN and ELSE statements may be nested.<br />

Multiple THEN and ELSE statements can alternatively be entered on<br />

separate lines. If so, the instruction should be appended by ENDIF. See<br />

second example below.<br />

Examples These two examples illustrates the different syntaxes:<br />

10 A%=100:B%=20<br />

20 C$="A LARGER THAN B"<br />

30 D$="A NOT LARGER THAN B"<br />

40 IF A%>B% THEN PRINT C$ ELSE PRINT D$<br />

RUN<br />

A LARGER THAN B<br />

yields:<br />

10 A%=VAL(TIME$)<br />

20 IF A%>120000 THEN<br />

30 PRINT "TIME IS ";TIME$; ". ";<br />

40 PRINT "GO TO LUNCH!"<br />

50 ELSE<br />

60 PRINT "CARRY ON - ";<br />

70 PRINT "THERE’S MORE WORK TO DO!"<br />

80 ENDIF<br />

RUN<br />

yields for example:<br />

TIME IS 121500. GO TO LUNCH!<br />

<strong>Intermec</strong> Fingerprint <strong>v8.70.0</strong>/v10.0.0 Programmer´s <strong>Reference</strong> <strong>Manual</strong> 117

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!