17.08.2013 Views

Contents, cont'd. - Intermec

Contents, cont'd. - Intermec

Contents, cont'd. - Intermec

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

WHILE...WEND<br />

Chapter 2 Program Instructions<br />

Field of Application Statement for executing a series of statements in a loop providing a given<br />

condition is true.<br />

Syntax WHILE <br />

<br />

[...]<br />

WEND<br />

is a numeric expression that is either TRUE (-1) of FALSE (0).<br />

is statement, or a list of statements on separate lines, that will<br />

be executed provided is TRUE.<br />

Remarks If is TRUE, all following statements will be executed successively<br />

until a WEND statement is encountered. The program execution then goes<br />

back to the WHILE statement and repeats the process, provided still<br />

is TRUE.<br />

If is FALSE, the execution resumes at the statement following the<br />

WEND statement.<br />

WHILE...WEND statements can be nested. Each WEND matches the most<br />

recent WHILE statement.<br />

Example In this example, the WHILE...WEND loop will only be executed if the<br />

character “Y” (ASCII 89 dec.) is entered on the keyboard of the host.<br />

10 B%=0<br />

20 WHILE B%89<br />

30 INPUT "Want to exit? Press Y=Yes or N=No ",A$<br />

40 B%=ASC(A$)<br />

50 WEND<br />

60 PRINT "The answer is Yes"<br />

70 PRINT "You will exit the program"<br />

80 END<br />

RUN<br />

yields:<br />

Want to exit? Press Y=Yes or N=No N<br />

Want to exit? Press Y=Yes or N=No Y<br />

The answer is Yes<br />

You will exit the program<br />

<strong>Intermec</strong> Fingerprint 7.2 – Reference Manual Ed. 3 244

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

Saved successfully!

Ooh no, something went wrong!