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.

LOC<br />

Chapter 2 Program Instructions<br />

Field of Application Function returning the current position in an OPENed file or the status<br />

of the buffers in an OPENed communication channel.<br />

Syntax LOC()<br />

is the number assigned to the file or communication channel<br />

when it was OPENed.<br />

Remarks In a random file, LOC will return the number of the last record read or written<br />

by the use of GET or PUT statements respectively.<br />

In a sequential file, the number of 128-byte blocks, that have been read or<br />

written since the file was OPENed, will be returned.<br />

LOC can also be used to check the receiver or transmitter buffer of the<br />

specified communication channel:<br />

• If the channel is OPENed for INPUT, the remaining number of characters<br />

(bytes) to be read from the receiver buffer is returned.<br />

• If the channel is OPENed for OUTPUT, the remaining free space (bytes)<br />

in the transmitter buffer is returned.<br />

The number of bytes includes characters that will be MAPped as NULL.<br />

Examples This example closes the file "addresses" when record No. 100 has been read<br />

from the file:<br />

10 OPEN "ADDRESSES" FOR INPUT AS #1<br />

.....<br />

.....<br />

.....<br />

200 IF LOC(1)=100 THEN CLOSE #1<br />

.....<br />

.....<br />

This example reads the number of bytes which remains to be received from<br />

the receiver buffer of "uart2:":<br />

100 OPEN "uart2:" FOR INPUT AS #2<br />

110 A%=LOC(2)<br />

120 PRINT A%<br />

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

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

Saved successfully!

Ooh no, something went wrong!