(02-18-2023, 09:39 AM)AtomicSlaughter Wrote: Could you not just keep all the data in comma delimited strings, and then just split them as you need them
that way there is no limit to the length of the strings and you can just add data to the end of the string giving unlimited results storage
Code: (Select All)ReDim sData(0) as string
open "StudentData.csv" for input as #1
do
line input #1, sData(ubound(sData))
ReDim _Preserve sData(Ubound(sData)+1)
loop until eof(1)
input "Enter name or id to search for> ",s$
for i = 1 to ubound(sData)
if instr(sData(i),s$) > 0 then print sData(i)
next
Sub Str2arr (ST As String, AR() As String, DL As String)
Dim Delim(Len(DL)) As String
For i = 1 To Len(DL)
Delim(i) = Mid$(DL, i, 1)
Next
'find first delim
c = 1
Do
For i = 1 To UBound(Delim)
If Mid$(ST, c, 1) = Delim(i) Then
ReDim _Preserve AR(UBound(AR) + 1)
c = c + 1
Exit For
End If
Next i
AR(UBound(AR)) = AR(UBound(AR)) + Mid$(ST, c, 1)
c = c + 1
Loop Until c > Len(ST)
End Sub
Already offered the same idea in first reply: https://qb64phoenix.com/forum/showthread...7#pid13567
And here I improved the idea by dumping the delimiters and used fixed length segments into a fixed length "array" string so that the data record, UDT data, could actually be filed like a database record. https://qb64phoenix.com/forum/showthread...9#pid13599
b = b + ...