A quick program I wrote, from a discussion in the chat room:
SCREEN _NEWIMAGE(800, 600, 32)
REDIM wordlist(1000000) AS STRING
OPEN "Scrabble WordList 2006.txt" FOR BINARY AS #1
DO UNTIL EOF(1)
wordcount = wordcount + 1
LINE INPUT #1, wordlist(wordcount)
LOOP
REDIM _PRESERVE wordlist(wordcount)
CLOSE
DO
INPUT "Search term:"; search$
search$ = UCASE$(search$)
s$ = LEFT$(search$, 3)
m$ = _TRIM$(MID$(search$, 4))
l = LEN(m$)
SELECT CASE s$
CASE "BEG"
PRINT "Words beginning with: "; m$
FOR i = 1 TO wordcount
IF LEFT$(wordlist(i), l) = m$ THEN PRINT wordlist(i),
NEXT
CASE "END"
PRINT "Words ending with: "; m$
FOR i = 1 TO wordcount
IF RIGHT$(wordlist(i), l) = m$ THEN PRINT wordlist(i),
NEXT
CASE "CON"
PRINT "Words containing: "; m$
FOR i = 1 TO wordcount
IF INSTR(wordlist(i), m$) THEN PRINT wordlist(i),
NEXT
CASE ELSE
END
END SELECT
PRINT
PRINT "**********************"
PRINT
LOOP
this does a search of our word lists for the following:
BEG xxxxx -- words beginning with "xxxxx"
END xxxxx -- words ending with "xxxxx"
CON xxxxx -- words which contain "xxxxx"
So to see which words begin with "THEN", we simply do a search for "BEG THEN".
To see which words end with "THEN", we do a search for "END THEN".
And to see which words contain "THEN" in them, we do a search for "CON THEN".
That's all there is to it. :D