Microsoft Small Basic

Program Listing: GFV964
Sub clean 'thanks to LitDev on the Small Basic forums for this!
cleandef = ""
For i = 1 To Text.GetLength(def)
char = Text.GetSubText(def,i,1)
code = Text.GetCharacterCode(char)
If ( code >= 0 And code <> 7 And code < 256) Then
cleandef = cleandef+char
EndIf
EndFor
def = cleandef
EndSub
Sub LookUp
TextWindow.ForegroundColor = "White"
TextWindow.WriteLine(Clock.Date)
TextWindow.WriteLine(Clock.Time)
Sound.PlayChimeAndWait()
TextWindow.WriteLine("Type a word and hit the Enter key to look it up!")
Speech.Speak("Type a word and hit they Enter key to look it up!")
word = TextWindow.Read()
TextWindow.WriteLine("Please wait...")
def = Dictionary.GetDefinition(word)
TextWindow.Write("Here is your definition for ")
TextWindow.Write(word)
TextWindow.Write(":")
Speech.Speak("Here is your definition for ")
Speech.Speak(word)
Speech.Speak(":")
clean()
TextWindow.WriteLine(def)
Sound.PlayBellRingAndWait()
TextWindow.WriteLine("Thank you for using the Dictionary Lookup!")
Speech.Speak("Thank you for using the Dictionary Lookup!")
EndSub

Sub Again
TextWindow.WriteLine("Would you like to look up another word?")
Speech.Speak("Would you like to look up another word?")
TextWindow.WriteLine("If yes, type the letter y. If no, type anything else. Afterwards, hit the Enter key.")
Speech.Speak("If yes, type the letter y. If no, type anything else. Afterwards, hit the Enter key.")
If (TextWindow.Read() = "y") Then
LookUp()
Again()
Else
TextWindow.WriteLine("Goodbye.")
Speech.Speak("Goodbye.")
Program.Delay(1000)
Program.End()
EndIf
EndSub

TextWindow.ForegroundColor = "Blue"
TextWindow.WriteLine("Welcome to Dictionary Lookup in Small Basic by iUberGeek/Abhi S.")
LookUp()
Again()