11-24-2022, 04:40 AM
Here's mine for an opened RA file of which I already know Word count, 32 is maximum word length (guessed):
Code: (Select All)
Function findW& (wd$)
Dim As Long lo, hi, m
Dim wrd As String * 32
lo = 1: hi = 279422
While lo <= hi
m = (hi + lo) / 2
Get #1, m, wrd
w$ = _Trim$(wrd)
If w$ = wd$ Then
findW& = m: Exit Function
ElseIf w$ < wd$ Then
lo = m + 1
ElseIf w$ > wd$ Then
hi = m - 1
End If
Wend
End Function
b = b + ...