Programming instructions

41
Intermec Fingerprint 6.13 – Programmer's Guide
5. FINGERPRINT PROGRAMMING, cont'd.
9. Loops, cont'd.
FOR...NEXT, cont'd.
This example shows how an incremental counter can be made:
10 INPUT "Start Value: ", A%
20 INPUT "Number of labels: ", B%
30 INPUT "Increment: ", C%
40 X%=B%*C%
50 FOR D%=1 TO X% STEP C%
60 FONT "SW030RSN"
70 MAG 2,2
80 PRPOS 100,200
90 PRTXT "TEST LABEL"
100 PRPOS 100,100
110 PRTXT "COUNTER: "; A%
120 PRINTFEED
130 A%=A%+C%
140 NEXT D%
RUN
WHILE...WEND
These statements are used to create loops where series of statements
are executed provided a given condition is TRUE.
WHILE is supplemented by a numeric expression, that can be either
TRUE (-1) or FALSE (0). If the condition is TRUE, all subsequent
program lines will be executed until a WEND statement is encoun-
tered. The execution then loops back to the WHILE statement and
the process is repeated, provided the WHILE condition still is
TRUE. If the WHILE condition is FALSE, the execution bypasses
the loop and resumes at the statement following the WEND
statement.
WHILE...WEND statements can be nested. Each WEND state-
ment matches the most recent WHILE statement.
This example shows a program that keeps running in a loop (line
20–50) until you press the Y key on the host (ASCII 89 dec.), i.e. the
WHILE condition becomes true.
10 B%=0
20 WHILE B%<>89
30 INPUT "Want to exit? Press Y=Yes or N=No",A$
40 B%=ASC(A$)
50 WEND
60 PRINT "The answer is Yes"
70 PRINT "You will exit the program"
80 END
RUN
Relational Operators
Also see:
Chapter 4.9