Specifications
231
Syntax:
INPUT #filenumber,variable[,variable...]
Parameter:
filenumber
A numeric expression which returns a value from 1 to 16.
variable
A numeric or string variable.
Description:
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 variable.
•
filenumber is a number assigned to the device I/O file when it was opened.
• Reading data from a communications device file:
An
INPUT # statement reads data fields separated by CR codes or commas (,)
and assigns them to
variable.
If more than one
variable is specified in an INPUT # statement, the program
waits until all of the specified
variables receive data.
If an
INPUT # statement reads data longer than the allowable string length, it
ignores only the overflowed data and completes execution, causing no run-time
error.
• Reading data from a bar code device file:
An
INPUT # statement reads the scanned data into the 1st variable.
If more than one variable is specified in an
INPUT # statement, the program
ignores the 2nd and the following
variables.
If an
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
INPUT #
Reads data from a device I/O file into specified variables.
TIP
If the maximum number of digits has been omitted in the read code spec-
ifications of the OPEN "BAR:" statement (except for the universal prod-
uct codes), then the INPUT # statement can read bar codes of up to 99
digits. To read bar codes exceeding 40 digits, you should define a suffi-
cient string variable length beforehand.