
230
____________________________________________________________________
File I/O statement
LINE INPUT #
Reads data from a device I/O file into a string variable.
____________________________________________________________________
Syntax:
Syntax:Syntax:
Syntax:
LINE INPUT #filenumber,stringvariable
Parameter:
Parameter:Parameter:
Parameter:
filenumber
A numeric expression which returns a value from 1 to 16.
stringvariable
A string variable.
Description:
Description:Description:
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 stringvariable.
• 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 execution,
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.
TIP
If the maximum number of digits has been omitted in the read code
specifications 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.
Comentários a estes Manuais