My problem here is that I wanted to use ReDim to adjust the number of elements. Unfortunately, the commented out code below fails miserably, it crashes. I've studied the help file, and it's not clear to me. Can anybody shed light into the mysteries of dynamic string arrays?
Code: Select all
Dim shared recstr(1000) As string ' fixed size is no good!
function Recall(fname As string) As integer
Dim As integer ct=0, maxct=1000
If Open(fname For Binary Access Read As #1) = 0 Then
While not eof(1)
Line Input #1, recstr(ct)
' if ct>=maxct then
' print "REDIM ";maxct;
' Redim recstr(maxct)
' print " ok, maxct=";maxct
' print ct;chr(13);
Print "Error opening file"
Dim As double tickssec=Timer
Dim As Integer ticks, records
print "loading ";Command$(1);" took ";
print ticks;" ms"
for i as integer=0 to records-1
if i<5 or i>records-5 then
elseif i=5 then