Programming instructions
65
Intermec Fingerprint 6.13 – Programmer's Guide
7. INPUT TO FINGERPRINT, cont'd.
4. Input from a Sequential
File, cont'd.
INPUT$
Reads a specified number of characters from the specified sequen-
tial file or channel. (If no file or channel is specified, the data on the
standard IN channel will be read). The execution is held up waiting
for the specified number of characters to be received. If a file does
not contain as many characters as specified in the INPUT$ state-
ment, the execution will be resumed as soon as all available
characters in the file have been received.
Sequential files are read from the start and once a number of
characters have been read, they cannot be read again until the file
is CLOSEd and OPENed again. Subsequent INPUT$ statements
will start with the first of the remaining available characters.
Example (reads portions of characters from a file OPENed as #1):
10 OPEN "QFILE" FOR OUTPUT AS #1
20 PRINT #1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
30 CLOSE #1
40 OPEN "QFILE" FOR INPUT AS #1
50 A$=INPUT$(10,1)
60 B$=INPUT$(5,1)
70 C$=INPUT$(100,1)
80 PRINT "Record 1:",A$
90 PRINT "Record 2:",B$
100 PRINT "Record 3:",C$
110 CLOSE #1
RUN
Yields:
Record1: ABCDEFGHIJ
Record2: KLMNO
Record3: PQRTSUVWXYZ
LINE INPUT#
Works similar to INPUT#, but reads an entire line including all
punctuation marks to a string variable instead of reading just one
record. Note that commas inside a string will be regarded as
punctuation marks and will not divide the string into records
(compare with INPUT#).
Example (reads a complete line in a file and places the data into a
single string variable):
10 OPEN "QFILE" FOR OUTPUT AS #1
20 PRINT #1, "Record A,Record B,Record C"
30 CLOSE #1
40 OPEN "QFILE" FOR INPUT AS #1
50 LINE INPUT #1, A$
60 PRINT A$
70 CLOSE #1
RUN
Yields:
Record A,Record B,Record C
Continued!