Input Function [VBA]

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

warning

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


Syntax:

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

Return value:

String

Parameters:

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

#: Optional.

FileNumber: Required. Any valid file number.

Error codes:

6 오버플로우가 발생했습니다.

52 잘못된 파일 이름 또는 번호입니다.

62 파일 끝(EOF)을 초과하여 읽었습니다

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

Please support us!