Help Center
Help CenterFreeBASIC

LOFfunction

Returns the length of an open disk file

File I/O Functionsfunctiondocumented

Syntax

Declare Function LOF ( ByVal filenum As Long ) As LongInt

Parameters

NameDescription
filenumThe file number of an open disk file.

Return value


The length in bytes of an open disk file.

Description


Returns the length, in bytes, of a file opened previously with Open using the given filenum.

With Open Com it returns the length of the data pending to be read in the receive buffer.

Remarks

Usage


result = LOF( filenum )

Differences from QB


  • None

See also


Example


Dim f As Long

f = FreeFile

Open "file.ext" For Binary As #f

Print LOF(f)

Close #f

Reference

  • Documented in KeyPgLof.html