Sub Process_Globals
Dim wordlist As List
End Sub
Sub AppStart (Args() As String)
Dim st1 As Long = DateTime.now
wordlist.Initialize
Dim textRdr As TextReader
textRdr.Initialize(File.OpenInput("d:/wordlist","words_alpha.txt"))
Dim wrd As String = textRdr.ReadLine
Do While wrd <> Null
wordlist.Add(wrd)
wrd = textRdr.readline
Loop
textRdr.Close
Log("loaded " & wordlist.size & " words in " & (DateTime.Now - st1) & " ms")
wordlist.Sort(True)
Dim st As Long = DateTime.now
Dim srchword As String = "muinimula"
Log("Search letters [" & srchword & "]")
Dim flag As Boolean = True
Dim savedword As String
For Each word As String In wordlist
savedword = word
flag = True
For a = 0 To srchword.Length - 1
If srchword.Length <> word.Length Then
flag = False
Exit
End If
If word.indexof(srchword.CharAt(a)) > -1 Then
If word.IndexOf(srchword.CharAt(a))=0 Then
word = "*" & word.SubString(word.IndexOf(srchword.CharAt(a))+1)
Else
word = word.SubString2(0,word.IndexOf(srchword.CharAt(a))) & "*" & word.SubString(word.IndexOf(srchword.CharAt(a))+1)
End If
Else
flag = False
Exit
End If
Next
If flag=True And word.Replace("*","")="" Then Log(savedword)
Next
Log((DateTime.Now - st) & " ms")
End Sub