Input, InputB

Returns a string containing characters from a file opened in Input or Binary mode. InputB returns bytes.

Syntax

file.Input(Number)

The parts of the Input and InputB statement syntax are described in the following table.

Part Description
Number Any valid numeric expression specifying the number of character to return.

Remarks

Data read with the Input function is usually written to a file with the LinePrint or Put functions. Use this function only with files opened in Input or Binary mode.

Unlike the LineInputString statement, the Input function returns all of the characters it reads, including commas, carriage returns, linefeeds, quotation marks, and leading spaces.

With files opened for Binary access, an attempt to read through the file using the Input function until the EOF function returns True generates an error. Use the LOF and Loc functions instead of EOF when reading binary files with the Input function, or use Get when using the EOF function.

.

Note Use the InputB function for byte data contained within text files. With InputB, number specifies the number of bytes to return rather than the number of characters to return.