
# Records in a RANDOM ACCESS file?
Remove MAPSON when replying via email
? Does someone know how to find out the total
? number of records in a random access file?
LOF returns the bytecount for the file; divide this by the length of each
row, and Robert's your father's brother.
EG
Type MyRowType
Name As String * 20
Address As String * 80
PostCode As String * 8
End Type
Dim MyRow As MyRowType
MyFile = FreeFile
Open "MYDATA.DAT" For Random as MyFile Len = Len(MyRow)
NoOfRows = Lof(MyFile) \ Len(MyRow)
Bump up NoOfRows before appending a new row:-
NoOfRows = NoOfRows + 1
Put MyFile, NoOfRows, MyRow
Rob Davis MSc MIAP Leicester, UK 0976 379489