Input Fonksiyonu [VBA]

Bir Girdi veya İkilik dosyasının (Karakter Dizisi) açık akışını döndürür.

warning

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


Sözdizimi:


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

Dönüş değeri:

String

Parametreler:

Sayı: Gerekli. Döndürülecek karakter sayısını belirten sayısal ifade.

#: Seçimsel.

DosyaNumarası: Gerekli. Geçerli bir dosya numarası.

Hata kodları:

6 Taşma

52 Geçersiz dosya adı veya numarası

62 Okuma EOF'u aştı

Örnek:


        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!