FileEOF Procedure

Determines whether End-Of-File for the file associated with hFile has been reached.

Syntax

[ lStatus = ] FileEOF ( hFile )

The FileEOF procedure syntax has the following parts:

 

Name

Type

Description

lStatus

Long

Status

hFile

Val AFile

Handle to the file

Comments

The lStatus may be one of the following:

 

0

EOF has not been reached.

1

EOF has been reached.

-1

An error encountered by the procedure or the nHandle parameter is not valid.

Example

The following example reads into an array of strings (asMsg) the content of the file. The file contains messages with a fixed length of 30 bytes each.

! the size of asMsg is 10

i=0

While FileEOF(hFile) <> 1 and i<10

FileRead(hFile, asMsg[i], 30)

i=i+1

Endwhile

See Also

FileCreate, FileOpen, FileRead, FileSeek, FileTell