LOF Function |
No
LOF(filenumber)
filenumber
Use: Required
Data Type: Integer
Any valid file number.
A Long integer.
Returns the size of an open file in bytes.
filenumber must be the number of a file opened using the Open statement.
The following example shows how to use the LOF function to determine the length of a data file and to determine the number of records it contains:
Open sFileName For Random As #iFile Len = Len(udtCustomer) iMaxRecs = LOF(iFile) / Len(udtCustomer) For iRec = 1 To iMaxRecs Get #1, iRec, udtCustomers(iRec) Next iRec Close #iFile
LOF works only on an open file; if you need to know the size of a file that isn't open, use the FileLen function.