I use length of file divided by record length to find the number of records, but although the record length shows correctly, the number of records is one more than it should be. Is that because LOF is incorrect? How can you tell? If you put a break point on it and let the cursor hover over that line nothing is shown as a value of LOF. The .dat file seems to be ok.
Open App.Path & "\Customers.dat" For Random As #1 Len = Len(Customer(Index))
NumberOfRecords = LOF(1) / Len(Customer(Index))
For Count = 1 to NumberOfRecords
Get #1, Count, Customer(Index)
Index = Index + 1
Next Count
Close #1
For i = 0 to Index
lstCustomerList.AddItem (Customer(i).CustomerID)
Next i
2006-11-15
22:41:29
·
1 answers
·
asked by
Older&Wiser
5
in
Programming & Design