LINE INPUT# deviceID, stringVar$
This statement reads a line of text data from the open file or open serial port specified by
deviceID, and stores the data into the string variable
deviceID equals zero, then
LINE INPUT# reads data from the keyboard.
LINE INPUT#0,stringVar$ is identical to
LINE INPUT stringVar$.
deviceID specifies a file, then
LINE INPUT# reads a line of text from the file, beginning at the current "file mark" position (which is usually at the beginning of the line), and ending when a carriage-return character is encountered, or the end of the file is encountered, or 255 characters have been read, whichever occurs first.
LINE INPUT# then assigns the entire string of characters to
stringVar$. the file mark is then advanced to a position just past the last character read.
deviceID specifies a serial port (i.e., if its value is
LINE INPUT# behaves in a similar way, except that the concepts of "file mark" and "end of file" generally don't apply.
LINE INPUT# is similar to
INPUT#, except that special characters such as commas, quotes and leading spaces are not interpreted as data item delimiters, but instead are copied directly into
If the file mark is already at the end of the file when you execute
LINE INPUT#, FB generates an "Input past end of file" error. To prevent this situation, check the value of
EOF(deviceID) before executing
INPUT#; LINE INPUT; EOF; OPEN