例: Input function

Dim fileNum As Integer
Dim fileName As String
Dim firstCheck As String
fileNum% = FreeFile()
fileName$ = "data.dat"
' Write out some employee data.
Open fileName$ For Output As fileNum%
Write #fileNum%, "Joe Smith", 123, "1 Smith Road", 25000.99
Write #fileNum%, "Jane Doe", 456, "Two Cambridge Center", _
      98525.66
Close fileNum%
' Read in first 23 characters of data and print.
Open fileName$ For Input As fileNum%
firstCheck$ = Input$(23, fileNum%)
Print firstCheck$   ' Output:  "Joe Smith",123,"1 Smit
Close fileNum%