Wort abgleichn und Information widergeben

  • Hallo :)
    Ich will eine Art Lexicon schreiben dazu fehlt mir nurnoch das der script das eingegebene Wort mit einer Liste abgleicht
    und dann die Information Rausgibt. ?(

    Wer nett wenn einer schnellst möglich antwortet 8o

    MfG Brokolie

  • ups sry

    [autoit]

    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <GUIListBox.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>

    #Region ### START Koda GUI section ### Form=C:\Users\Brokolie\Desktop\verschiedenes\AutoIt\GUI\GUI'S\SceneLexicon.kxf
    $SceneLexicon = GUICreate("Lexicon", 381, 104, 192, 124, BitOR($WS_POPUP,$WS_CLIPSIBLINGS))
    GUISetBkColor(0x000000)
    $wort = GUICtrlCreateInput("Lexicon by Brokolie", 16, 8, 145, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL))
    GUICtrlSetColor(-1, 0x0080FF)
    $Start = GUICtrlCreateButton("Start", 216, 8, 113, 33, 0)
    GUICtrlSetFont(-1, 15, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x0080FF)
    GUICtrlSetBkColor(-1, 0x646464)
    $Close = GUICtrlCreateButton("Close", 216, 48, 113, 33, 0)
    GUICtrlSetFont(-1, 15, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x0080FF)
    GUICtrlSetBkColor(-1, 0x696969)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x0080FF)
    $Icon1 = GUICtrlCreateIcon("C:\Users\Brokolie\Desktop\verschiedenes\AutoIt\icons\Toolbox.ico", 0, 128, 32, 64, 64, BitOR($SS_NOTIFY,$WS_GROUP))
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###
    Func _Check()
    $read = GUICtrlRead($wort)
    If $read = "UIN" Then
    MsgBox(64,"Lösung","UIN ist eine ICQ-Nummer!")
    Else
    MsgBox(16,"Wort Unbekannt","Dieses Wort ist mir Unbekannt!")
    EndIf
    EndFunc
    $read = GUICtrlRead($wort)
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $Close
    Exit
    Case $Start
    _Check()

    EndSwitch
    WEnd

    [/autoit]
  • Eine Möglichkeit:

    Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <GUIListBox.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    #Region ### START Koda GUI section ### Form=C:\Users\Brokolie\Desktop\verschiedenes\AutoIt\GUI\GUI'S\SceneLexicon.kxf
    $SceneLexicon = GUICreate("Lexicon", 381, 104, 192, 124, BitOR($WS_POPUP,$WS_CLIPSIBLINGS))
    GUISetBkColor(0x000000)
    $wort = GUICtrlCreateInput("Lexicon by Brokolie", 16, 8, 145, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL))
    GUICtrlSetColor(-1, 0x0080FF)
    $Start = GUICtrlCreateButton("Start", 216, 8, 113, 33, 0)
    GUICtrlSetFont(-1, 15, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x0080FF)
    GUICtrlSetBkColor(-1, 0x646464)
    $Close = GUICtrlCreateButton("Close", 216, 48, 113, 33, 0)
    GUICtrlSetFont(-1, 15, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x0080FF)
    GUICtrlSetBkColor(-1, 0x696969)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x0080FF)
    $Icon1 = GUICtrlCreateIcon("C:\Users\Brokolie\Desktop\verschiedenes\AutoIt\icons\Toolbox.ico", 0, 128, 32, 64, 64, BitOR($SS_NOTIFY,$WS_GROUP))
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $Close
    Exit
    Case $Start
    _Check()
    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _Check()
    $file=FileRead("datei.txt")
    $lines=StringSplit($file,@CRLF)
    For $i = 1 to $lines[0]
    $Split=StringSplit($lines[$i],"|")
    If $Split[1] = GUICtrlRead($wort) Then
    MsgBox(0,"Ergebnis",$Split[2])
    ExitLoop
    Else
    MsgBox(0,"","Ende")
    ExitLoop
    EndIf
    Next
    EndFunc

    [/autoit]

    Die Datei müsste dann so aussehen:
    Suchwort|Erklärung
    Suchwort2|Erklärung2
    ...

    ;)

    MfG
    Conan (Nur Mitlesend)
    Schon lange dabei

    Einmal editiert, zuletzt von Conan10 (5. November 2009 um 19:10)

  • also schonmal danke...aber^^
    wenn man was flasch eigitb kommt die ganze zeit "ende"
    wenn man es wegdrückt kommt es neu :D

    • Offizieller Beitrag

    Geht auch mit IniRead:

    Spoiler anzeigen
    [autoit]


    #cs **************************************************************************

    [/autoit] [autoit][/autoit] [autoit]

    Wort abgleichn und Information widergeben

    [/autoit] [autoit][/autoit] [autoit]

    http://www.autoit.de/index.php?page…0262#post120262

    [/autoit] [autoit][/autoit] [autoit]

    #ce **************************************************************************

    [/autoit] [autoit][/autoit] [autoit]

    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <GUIListBox.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    #Region ### START Koda GUI section ### Form=C:\Users\Brokolie\Desktop\verschiedenes\AutoIt\GUI\GUI'S\SceneLexicon.kxf
    $SceneLexicon = GUICreate("Lexicon", 381, 104, 192, 124, BitOR($WS_POPUP, $WS_CLIPSIBLINGS))
    GUISetBkColor(0x000000)
    $wort = GUICtrlCreateInput("Lexicon by Brokolie", 16, 8, 145, 21, BitOR($ES_CENTER, $ES_AUTOHSCROLL))
    GUICtrlSetColor(-1, 0x0080FF)
    $Start = GUICtrlCreateButton("Start", 216, 8, 113, 33, 0)
    GUICtrlSetFont(-1, 15, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x0080FF)
    GUICtrlSetBkColor(-1, 0x646464)
    $Close = GUICtrlCreateButton("Close", 216, 48, 113, 33, 0)
    GUICtrlSetFont(-1, 15, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x0080FF)
    GUICtrlSetBkColor(-1, 0x696969)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x0080FF)
    $Icon1 = GUICtrlCreateIcon("C:\Users\Brokolie\Desktop\verschiedenes\AutoIt\icons\Toolbox.ico", 0, 128, 32, 64, 64, BitOR($SS_NOTIFY, $WS_GROUP))
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $Close
    Exit
    Case $Start
    _Check()
    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _Check()
    $read = GUICtrlRead($wort)
    $answer = IniRead("Lexicon.ini", "Words", $read, "")
    If $answer <> "" Then MsgBox(64, "Lösung", $answer)
    EndFunc ;==>_Check

    [/autoit]


    Die Inidatei muss dann so aussehen:

    Code
    [Words]
    uin="UIN ist eine ICQ-Nummer!"
  • kommt kein fehler wenn ich zb. den begriff "acc" (2. stelle im gesammten verzechnes) abfrage kommt die antwort wenn ich dann aber das letze "rofl" nehme passiert garnichts

    • Offizieller Beitrag

    Du darfst in der Ini nur eine Sektion haben:

    Spoiler anzeigen
  • Oscar ,
    wenn Dein Name im Zusammenhang mit Lexika/Wörterbüchern fällt, assoziiere ich das SOFORT mit dem Dictionary-Objekt :thumbup: ...also lass die Jungs nicht hängen und zeig mal wie man so etwas "schnell" löst :D