Programming instructions

77
Intermec Fingerprint 6.13 – Programmer's Guide
7. INPUT TO FINGERPRINT, cont'd.
8. Background
Communication, cont'd.
LOF (Length-of-File)
The LOF function returns the status of the buffers in an OPENed
communication channel:
- If a channel is OPENed for INPUT, the remaining free space
(bytes) in the receive buffer is returned.
- If a channel is OPENed for OUTPUT, the remaining number of
characters to be transmitted from the transmitter buffer is returned.
The example shows how the number of free bytes in the receive
buffer of communication channel "uart2:" is calculated:
10 OPEN "uart2:" FOR INPUT AS #2
20 A%=LOF(2)
30 PRINT A%
...
...
80 COMSET 1 ON
90 IF QDATA$="" THEN GOTO 90
100 END
1000 QDATA$=COMBUF$(1)
1010 IF COMSTAT(1) AND 2 THEN PRINT A$
1020 IF COMSTAT(1) AND 4 THEN PRINT B$
1030 IF COMSTAT(1) AND 8 THEN PRINT C$
1040 IF COMSTAT(1) AND 32 THEN PRINT D$
1050 PRINT QDATA$
1060 RETURN
RUN