When you REDIM preserve, you are allocating the memory each time through.
There's no need to REDIM PRESERVE on each record. You can get the number of records before you load the data:
Code:
' load whole file into A$.. Numrecs = TALLY(a$, CHR$(13)) ' each record in input is terminated by CRLF if a text file REDIM rec(1 to numrecs) AS recType ' Load one by one or whatever
Code:
Numrecs = LOF(#1) \ %INPUT_FILE_RECORD_LENGTH
Leave a comment: