03-02-2024, 03:51 AM
(This post was last modified: 03-02-2024, 03:55 AM by PhilOfPerth.)
I haven't analyzed all those listings, but this seems to me to be the simplest search:
... using the binary search that bplus showed (amended/maybe corrupted a bit).
Works for me, anyway, including AA, ZEBRA, ZZZS and CAT!
(RA.txt is an RA file with len = 11)
Code: (Select All)
Open "RA.txt" For Random As #1 Len = 11
bot = 0: top = LOF(1) \ 11 + 2: found = 0
Input "Word"; wrd$
wrd$ = UCase$(wrd$)
While Abs(top - bot) > 1
srch = Int((top + bot) / 2)
Get #1, srch, a$
a$ = UCase$(a$)
If a$ = wrd$ Then Print wrd$; " found at"; srch: found = 1: Sleep 2
If a$ < wrd$ Then ' too low
bot = srch
Else
top = srch
End If
Wend
Close
If found = 0 Then Print "Not found": Sleep 2
Cls
Run
... using the binary search that bplus showed (amended/maybe corrupted a bit).
Works for me, anyway, including AA, ZEBRA, ZZZS and CAT!
(RA.txt is an RA file with len = 11)
Of all the places on Earth, and all the planets in the Universe, I'd rather live here (Perth, Western Australia.) 
Please visit my Website at: http://oldendayskids.blogspot.com/

Please visit my Website at: http://oldendayskids.blogspot.com/