Siebel VB Language Reference > VB Language Reference >
This standard VB function is used to determine whether the end of an open file has been reached.
The file number used in the Open statement to open the file
The value -1 if the end of the specified open file has been reached, 0 otherwise.
For more information about assigning numbers to files when they are opened, read Open Statement.
This example uses the Eof function to read records from a Random file, using a Get statement. The Eof function keeps the Get statement from attempting to read beyond the end of the file. The subprogram,
CreateFile, creates the file
C:\TEMP001 used by the main subprogram. For another example, read FileDateTime Function.
Declare Sub CreateFile
' Put the numbers 1-10 into a file
Dim x as Integer
Open "C:\TEMP001" for Output as #1
For x = 1 to 10
Write #1, x
Dim msgtext as String
newline = Chr(10)
Open "C:\temp001" For Input As #1
msgtext = "The account numbers are:" & newline
Do While Not Eof(1)
msgtext = msgtext & newline & acctno & newline
Line Input Statement