Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to format a While... Wend correctly?
#38
Oh that looks pretty nice and efficient, way to use that tab char!

OK I was testing that function and it found another definition for CAT:
Code: (Select All)
Dim Shared words As String
words = _ReadFile$("Collins.txt")

Do
    Input "Enter word to lookup "; lookup$
    result$ = FindWord$(lookup$)
    If result$ = "" Then Print lookup$; " Not Found." Else Print result$
    Print
Loop Until lookup$ = ""

Function FindWord$ (wrd$) ' thanks mdijkens
    fpos& = InStr(words, UCase$(wrd$) + Chr$(9))
    If fpos& > 0 Then
        fpos& = fpos& + Len(wrd$) + 1
        eol& = InStr(fpos&, words, Chr$(13))
        FindWord$ = Mid$(words, fpos&, eol& - fpos&)
    End If
End Function
   

So it found cat somewhere else in Collins.txt???

I verified the Collins def of CAT as 'to vomit' so how are we finding this new definition?

Also mouse looked different.
b = b + ...
Reply


Messages In This Thread
RE: How to format a While... Wend correctly? - by bplus - 03-01-2024, 01:39 PM



Users browsing this thread: 16 Guest(s)