02.10.2012 Views

Programmer's Reference Manual Intermec Fingerprint® v8.70.0 ...

Programmer's Reference Manual Intermec Fingerprint® v8.70.0 ...

Programmer's Reference Manual Intermec Fingerprint® v8.70.0 ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter —Program Instructions<br />

EOF<br />

Purpose Function for checking for an end-of-file condition.<br />

Syntax EOF()<br />

is the number assigned to the file when it was OPENed.<br />

Remarks The EOF function can be used with files OPENed for sequential input in<br />

connection with the statements INPUT#, LINE INPUT#, and INPUT$<br />

to avoid the error condition “Input past end” which has no error message.<br />

When the EOF function encounters the end of a file, it returns the value<br />

-1 (true). If not, it returns the value 0 (false).<br />

Example 10 DIM A%(10)<br />

20 OPEN "DATA" FOR OUTPUT AS #1<br />

30 FOR I%=1 TO 10<br />

40 PRINT #1, I%*1123<br />

50 NEXT I%<br />

60 CLOSE #1<br />

70 OPEN "DATA" FOR INPUT AS #2<br />

80 I%=0<br />

90 WHILE NOT EOF(2)<br />

100 INPUT #2, A%(I%):PRINT A%(I%)<br />

110 I%=I%+1:WEND<br />

120 IF EOF(2) THEN PRINT "End of File"<br />

RUN<br />

1123<br />

2246<br />

3369<br />

4492<br />

5615<br />

6738<br />

7861<br />

8984<br />

10107<br />

11230<br />

End of File<br />

yields:<br />

7 <strong>Intermec</strong> Fingerprint <strong>v8.70.0</strong>/v10.0.0 Programmer´s <strong>Reference</strong> <strong>Manual</strong>

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

Saved successfully!

Ooh no, something went wrong!