Specifications

251
Syntax:
LINE INPUT #filenumber,stringvariable
Parameter:
filenumber
A numeric expression which returns a value from 1 to 16.
stringvariable
A string variable.
Description:
LINE INPUT # reads data from a device I/O file (a communications device file or
bar code device file) specified by
filenumber and assigns it to stringvari-
able
.
filenumber is a number assigned to the device I/O file when it was opened.
A
LINE INPUT # statement cannot assign a numeric variable. (An INPUT #
statement can do.)
Reading data from a communications device file:
A
LINE INPUT # statement reads all of the string literals preceding a CR code
and assigns them to
stringvariable except for CR codes and LF codes
which immediately follow a CR code.
If a
LINE INPUT # statement reads data longer than the allowable string length
before reading a CR code, it ignores only the overflowed data and completes exe-
cution, causing no run-time error.
Reading data from a bar code device file:
A
LINE INPUT # statement reads the scanned data into stringvariable.
If a
LINE INPUT # statement reads data longer than the allowable string length,
it ignores only the overflowed data and completes execution, causing no run-time
error.
File I/O statement
LINE INPUT #
Reads data from a device I/O file into a string variable.
TIP
If the maximum number of digits has been omitted in the read code specifica-
tions of the
OPEN "BAR:" statement (except for the universal product codes),
then the LINE INPUT # statement can read bar codes of up to 99 digits. To
read bar codes exceeding 40 digits, you should define a sufficient string variable
length beforehand.