#include #include #include #include #include #include $Main = GUICreate("English Dictionary", 600, 370) $Edit = GUICtrlCreateEdit("", 15, 15, 570, 300, BitOR($ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_READONLY, $ES_WANTRETURN, $WS_VSCROLL, $WS_HSCROLL)) GUICtrlSetFont(-1, 10, 400, 0, "Arial") $Input = GUICtrlCreateInput("", 15, 330, 405, 25) GUICtrlSetFont(-1, 12, 400, 0, "Arial") $Search = GUICtrlCreateButton("Search", 435, 330, 150, 25, $BS_DEFPUSHBUTTON) GUICtrlSetFont(-1, 10, 400, 0, "Arial") GUISetState() While 1 Switch GUIGetMsg() Case $Search $Result = Look_Up(GUICtrlRead($Input)) If $Result = -1 Then MsgBox(262192, "ERROR", "That word is not in the dictionary!") GUICtrlSetData($Edit, "") Else GUICtrlSetData($Edit, $Result) EndIf Case - 3 Exit EndSwitch WEnd Func Look_Up($Word) If StringRegExp($Word, "[^a-zA-Z+]") = 1 Then Return -1 $Website = "http://dictionary.reference.com/browse/" & $Word $Source = _INetGetSource($Website) $Test = _StringBetween($Source, '
', '') If Not @error And StringStripWS(StringLower($Test[0]), 3) = "no results found for" Then Return -1 $Source = StringTrimLeft($Source, StringInStr($Source, '') + 15) $Source = StringReplace($Source, '
Origin:', '") $Line1 = $string[0] If StringInStr($Line1, ",") Then $Line1 = StringLeft($Line1, StringInStr($Line1, ",") - 1) $Line1 = StringRegExpReplace($Line1, "[^a-zA-Z]", "") & @CRLF $Source = _StringBetween($Source, '1. ', '