Intermec PF2i Fingerprint Developer's Guide (old) - Page 30
Using Line Numbers, Programming Without Line Numbers, Understanding Fingerprint Syntax
View all Intermec PF2i manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 30 highlights
Chapter 2 - Understanding Fingerprint Syntax Using Line Numbers You can manually enter line numbers as you write program lines. Intermec recommends that you start with line number 10 and use an increment of 10 between lines to allow additional lines to be inserted later if necessary. To make the program easier to read, you can use a space character between the line number and the instruction. If you do not use a space, Fingerprint automatically inserts a space character when the program is listed. The next example shows a short program with line numbers: 10 PRPOS 200,200 20 DIR 3 30 ALIGN 5 40 PRIMAGE "GLOBE.1" 50 PRINTFEED RUN The last line has no line number, and contains the RUN command plus a carriage return. This orders the printer to execute all preceding lines in consecutive ascending order according to their line numbers. In this manual, the programming examples will generally have line numbers in order to make them easier to understand. For more complex programs, programming without line numbers may be both easier and quicker as described in the next section. Programming Without Line Numbers To write program lines without manually entering line numbers, send the IMMEDIATE OFF command first. Then you can write the program line by line without having to type a line number at the start of each line. In other respects, you can generally work just as when using line numbers. To make the execution branch to a certain line, such as a GOTO statement, the line to branch to must start with a line label, which is a string of characters appended by a colon (:). The line label must not start with a digit or interfere with any keywords reserved by Fingerprint. To branch to a line marked with a line label, just enter the line label (without the colon). Finish the program by sending an IMMEDIATE ON command before you RUN it. The lines will automatically be numbered 10-20-30-40-50, and so on, but the line numbers are not visible until you LIST the program. Line labels are not replaced by line numbers. The next example shows how line labels are used in a simple program: IMMEDIATE OFF GOSUB Q123 END Q123:SOUND 440,50 RETURN IMMEDIATE ON RUN If you next send the LIST command, Fingerprint automatically adds the line numbers: 14 Intermec Fingerprint Developer's Guide