FXEZh‖

5rfjC‖Input Function [VBA]

FGDak‖Returns the open stream of an Input or Binary file (String).

warning

R9TFi‖This constant, function or object is enabled with the statement Option VBASupport 1 placed before the executable program code in a module.


FVEx2‖Syntax:


        Input( Number as Integer, [# ] FileNumber as Integer)
    

bBBqF‖Return type:

String

WADQ4‖Parameters:

h4M8G‖Number: Required. Numeric expression specifying the number of characters to return.

qTBRe‖#: Optional.

LTcsz‖FileNumber: Required. Any valid file number.

SEjHR‖Error codes:

6 Overflow

52 Invalid file name or file number

62 Reading exceeds EOF

EFSA4‖Example:


        REM ***** BASIC *****
        Option VBASupport 1
        Sub Example_Input
            Dim MyData
            Open "MyDataFile.txt" For Input As #1
            Do While Not EOF(1)
                MyData = Input(1, #1)
                Print MyData
            Loop
            Close #1
        End Sub