Intermec PM43/PM43c Fingerprint Developer's Guide (PC23d, PC43d/t, PM23c, PM43 - Page 31
Using an ON BREAK...GOSUB Instruction, Understanding Fingerprint Syntax
View all Intermec PM43/PM43c manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 31 highlights
Chapter 2 - Understanding Fingerprint Syntax ON...GOTO is shown in this example: 10 20 30 1000 2000 3000 RUN INPUT "Press key 1, 2, or 3 on host: ", A% ON A% GOTO 1000, 2000, 3000 END PRINT "You have pressed key 1": GOTO 30 PRINT "You have pressed key 2": GOTO 30 PRINT "You have pressed key 3": GOTO 30 Using an ON BREAK...GOSUB Instruction When a BREAK condition occurs on a specified device, the execution is interrupted and branched to a specified subroutine. For example, the program can make the printer emit a sound or display a message before the program is terminated. You can also let the program execution continue along a different path. In the next example, the program is interrupted when the Shift and Pause keys on the printer keyboard are pressed. The execution branches to a subroutine, which emits a siren-sounding signal three times. Then the execution returns to the main program, which is indicated by a long shrill signal. 10 20 30 40 50 60 70 1000 1010 1020 1030 1040 RUN BREAK 1,35 BREAK 1 ON ON BREAK 0 GOSUB 1000:REM Break from keyboard ON BREAK 1 GOSUB 1000:REM Break from host (#) GOTO 50 SOUND 800,100 BREAK 1 OFF: END FOR A%=1 TO 3 SOUND 440,50 SOUND 349,50 NEXT A% GOTO 60 Using an ON COMSET...GOSUB Instruction When one of several specified conditions interrupts the background communication on a certain communication channel, the program branches to a subroutine, such as reading the buffer. The interrupt conditions (end character, attention string, or maximum number of characters) are specified by a COMSET statement as in this example: 1 10 20 30 40 50 60 1000 2000 2010 2020 2030 REM Exit program with #STOP& COMSET1,"#","&","ZYX","=",50 ON COMSET 1 GOSUB 2000 COMSET 1 ON IF A$ "STOP" THEN GOTO 40 COMSET 1 OFF END END A$= COMBUF$(1) PRINT A$ COMSET 1 ON RETURN Fingerprint Developer's Guide 19