17.08.2013 Views

Contents, cont'd. - Intermec

Contents, cont'd. - Intermec

Contents, cont'd. - Intermec

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.

EOF<br />

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

Syntax EOF()<br />

Chapter 2 Program Instructions<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$ to<br />

avoid the error condition "Input past end" which has no error message. When<br />

the EOF function encounters the end of a file, it returns the value -1 (true). If<br />

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 />

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

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

Saved successfully!

Ooh no, something went wrong!