Skip to content

LOF ​


Returns the length of an open disk file

Syntax ​

` declare function Lof ( byval filenum as long ) as longint

`

Usage ​

` result = Lof( filenum )

`

Parameters ​

filenum

The 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.

Examples ​

start GeSHi

vb
Dim f As Long
f = FreeFile
Open "file.ext" For Binary As #f
Print LOF(f)
Close #f

end GeSHi

Differences from QB ​

  • None

See also ​

  • Loc
  • Eof
  • Open

Back to DocToc

Translated from FreeBASIC official docs. Contact us for removal if infringed.
FreeBASIC is an open-source project, not affiliated with Microsoft