Purpose
Returns the length of an open file.
Syntax
LOF( filenum )
filenum is the number of an open file.
Return Value
LargeInt value
Description
The LOF() function returns the length of an open file, in bytes.
The file parameter represents the number of an open file; this is the same number specified in the As clause of the Open File statement.
Error Conditions
ERR_FILEMGR_NOTOPEN (366) error generated if the specified file is not open.
Example
Dim size As Integer
Open File "import.txt" For Binary As #1
size = LOF(1)
' size now contains the # of bytes in the file
See Also:
Open File statement