04-01-2025, 09:30 AM
Be aware that the following is very slow with >10000 lines:
For 370099 lines, the following is over 100x faster:
For larger files this differences is even bigger
Code: (Select All)
Open "word lists\370099 Word List.txt" For Binary As #1
Print "Attempting to load 370,099 words into memory..."
Do Until EOF(1)
Line Input #1, Words(count)
count = count + 1
Loop
For 370099 lines, the following is over 100x faster:
Code: (Select All)
t$ = _ReadFile$(" word lists\370099 Word List.txt")
p0& = 1: p& = InStr(t$, Chr$(13))
Do While p& > 0
Words(count) = Mid$(t$, p0&, p& - p0&)
count = count + 1
p0& = p& + 2: p& = InStr(p0&, t$, Chr$(13))
Loop
Words(count) = Mid$(t$, p0&)
For larger files this differences is even bigger
45y and 2M lines of MBASIC>BASICA>QBASIC>QBX>QB64 experience