Input # Statement

 

Input   # filenumber, variablelist

 

Input  # Statement reads data from a sequential file and assigns that data to variables.

 

The Input # Statement has two parameters  filenumber and variablelistfilenumber is the number used in the open statement when the file was opened and variablelist is a Comma-delimited list of the variables that are assigned when read from the file..

 

Example:

 

Dim MyString, MyNumber

Open "c:\TESTFILE" For Input As #1   ' Open file for input.

Do While Not EOF(1)   ' Loop until end of file.

   Input #1, MyString, MyNumber   ' Read data into two variables.

Loop

Close #1   ' Close file.