Input (function)

<< Click to Display Table of Contents >>

Input (function)

Input(n, [#]FileNumber)

Reads a string from a file.

n is the number of the characters (bytes) to be read.

FileNumber is the number assigned to the respective file by the Open statement.

See also: Line Input, Open, Seek

Example:

Sub Main

 Open "TESTFILE" For Input As #1   ' Open file

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

         MyStr = Input(10, #1)          ' Read 10 characters

         MsgBox MyStr

 Loop

 Close #1                          ' Close file

End Sub