FileTell Procedure

Returns the current position of the specified file.

Syntax

[ lPos = ] FileTell ( hFile )

The FileTell procedure syntax has the following parts:

 

Name

Type

Description

lPos

Long

Position of the file pointer

hFile

Val AFile

Handle to an open file

Comments

The lPos is expressed as the number of bytes from the beginning of the file. The function returns -1 if the procedure has failed.

Example

The following example calculates current record number according to the nRecordSize and the current file pointer position:

lPos = FileTell(hFile)

If lPos < 0 Then

Print "Error During FileTell..."

Else

lRecordNum = lPos/nRecordSize

Endif

See Also

FileEOF, FileRead, FileSeek