Script-Problem mit messageloop

  • Hallo @all,
    ich habe ein Problem mit folgendem Skript:

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>

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

    Example()
    ;==== Dialog: =======================================
    Func Example()
    ;---- Optionen -------------------------------------
    GUICreate(" Error-Reporting")
    GUICtrlCreateLabel("Bitte wählen sie die Gruppe aus, in die ihr Problem am besten passt.", 7, 4)
    GUICtrlCreateGroup("Fehler", 7, 25, 120, 60)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    GUICtrlCreateGroup("Anderes Problem", 130, 25, 130, 85)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Weiter = GUICtrlCreateButton("Angaben speichern.", 100, 370)
    $Abbrechen = GUICtrlCreateButton("Abbrechen.", 210, 370)

    GUIStartGroup()
    $radio_FM = GUICtrlCreateRadio("Fehlermeldung", 10, 40)
    $radio_FA = GUICtrlCreateRadio("Abstürtze", 10, 60)
    $radio_KM = GUICtrlCreateRadio("Komische Meldung", 140, 40)
    $radio_KV = GUICtrlCreateRadio("Seltsames Verhalten", 140, 60)
    $radio_KF = GUICtrlCreateRadio("Frage", 140, 80)
    GUISetState()

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


    Do
    $msg = GUIGetMsg()

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

    Select
    Case $msg = $radio_FM
    $T = 1
    Case $msg = $radio_FA
    $T = 2
    Case $msg = $radio_KM
    $T = 3
    Case $msg = $radio_KV
    $T = 4
    Case $msg = $radio_KF
    $T = 5
    Case $msg = $Abbrechen
    Exit
    Case $msg = $Weiter
    GUIDelete()
    Case $msg = $Abbrechen
    MsgBox(0, "You clicked on", "Exit")
    Exit
    Case $msg = $GUI_EVENT_CLOSE
    MsgBox(0, "You clicked on", "Close")
    Exit
    EndSelect
    Until $msg = $GUI_EVENT_CLOSE Or $msg = $Abbrechen
    EndFunc
    MsgBox(0, "TEST", "$t =" & $T)

    [/autoit]

    Das Problem:
    Nachdem mann auf Speichern gedrückt hat steht die ganze Zeit beim AutoIt-Icon: Line 32.

    Und es geht einfach nicht weiter.

    Anmerkung:
    DerSkript soll eine andere Funktion haben, die noch nicht eingebaut ist. Ich teste immer nach jedem einzelnen Schritt ob alles klappt. Und dieses Problem kriege ich einfach nicht gelöst.

  • Schau mal, so?

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>

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

    Global $aRadio[5]

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

    $hGui = GUICreate("Error-Reporting")
    GUICtrlCreateLabel("Bitte wählen sie die Gruppe aus, in die ihr Problem am besten passt.", 7, 4)
    GUICtrlCreateGroup("Fehler", 7, 25, 120, 60)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    GUICtrlCreateGroup("Anderes Problem", 130, 25, 130, 85)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Weiter = GUICtrlCreateButton("Angaben speichern", 100, 370, 120, 25)
    $Abbrechen = GUICtrlCreateButton("Abbrechen", 220, 370, 80, 25)
    GUIStartGroup()
    $aRadio[0] = GUICtrlCreateRadio("Fehlermeldung", 10, 40)
    $aRadio[1] = GUICtrlCreateRadio("Abstürze", 10, 60)
    $aRadio[2] = GUICtrlCreateRadio("Komische Meldung", 140, 40)
    $aRadio[3] = GUICtrlCreateRadio("Seltsames Verhalten", 140, 60)
    $aRadio[4] = GUICtrlCreateRadio("Frage", 140, 80)
    GUISetState()

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

    While 1
    Switch GUIGetMsg()
    Case $GUI_EVENT_CLOSE
    MsgBox(0, "You clicked on", "Close")
    Exit
    Case $Abbrechen
    MsgBox(0, "You clicked on", "Exit")
    Exit
    Case $Weiter
    For $i = 0 To UBound($aRadio) - 1
    If BitAND(GUICtrlRead($aRadio[$i]), $GUI_CHECKED) Then $T = $i + 1
    Next
    MsgBox(0, "TEST", "$t =" & $T)
    EndSwitch
    WEnd

    [/autoit]
  • Danke an m-obi. :thumbup:

    Ich hab den -Skript verändert, uns habe wieder ein problem.

    Skript:
    [autoit]

    #include <GUIConstantsEx.au3>
    Opt("TrayIconDebug", 1)

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

    Global $aRadio[5]

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

    $hGui = GUICreate("Error-Reporting")
    GUICtrlCreateLabel("Bitte wählen sie die Gruppe aus, in die ihr Problem am besten passt.", 7, 4)
    GUICtrlCreateGroup("Fehler", 7, 25, 120, 60)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    GUICtrlCreateGroup("Anderes Problem", 130, 25, 130, 85)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Weiter = GUICtrlCreateButton("Angaben speichern", 100, 370, 120, 25)
    $Abbrechen = GUICtrlCreateButton("Abbrechen", 220, 370, 80, 25)
    GUIStartGroup()
    $aRadio[0] = GUICtrlCreateRadio("Fehlermeldung", 10, 40)
    $aRadio[1] = GUICtrlCreateRadio("Abstürze", 10, 60)
    $aRadio[2] = GUICtrlCreateRadio("Komische Meldung", 140, 40)
    $aRadio[3] = GUICtrlCreateRadio("Seltsames Verhalten", 140, 60)
    $aRadio[4] = GUICtrlCreateRadio("Frage", 140, 80)
    GUISetState()

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

    While 1
    Switch GUIGetMsg()
    Case $GUI_EVENT_CLOSE
    MsgBox(0, "You clicked on", "Close")
    Exit
    Case $Abbrechen
    MsgBox(0, "You clicked on", "Exit")
    Exit
    Case $Weiter
    For $i = 0 To UBound($aRadio) - 1
    If BitAND(GUICtrlRead($aRadio[$i]), $GUI_CHECKED) Then $T = $i + 1
    Next
    MsgBox(0, "TEST", "$t =" & $T)
    GUIDelete()
    EndSwitch
    WEnd

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

    If $T > 0 AND < 2 Then
    MsgBox(0, "TEST", "1")
    ElseIf $T > 1 AND < 3 Then
    MsgBox(0, "TEST", "2")
    ElseIf $T > 2 AND < 4 Then
    MsgBox(0, "TEST", "3")
    ElseIf $T > 3 AND < 5 Then
    MsgBox(0, "TEST", "4")
    ElseIf $T > 4 AND < 6 Then
    MsgBox(0, "TEST", "5")
    Else
    MsgBox(0, "TEST", "FEHLER !")
    EndIf

    [/autoit]

    Am #ende kommt einfach keine Meldung.
    Überhaupt nichts

  • Versuch mal so;)

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>

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

    Global $aRadio[5]

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

    $hGui = GUICreate("Error-Reporting")
    GUICtrlCreateLabel("Bitte wählen sie die Gruppe aus, in die ihr Problem am besten passt.", 7, 4)
    GUICtrlCreateGroup("Fehler", 7, 25, 120, 60)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    GUICtrlCreateGroup("Anderes Problem", 130, 25, 130, 85)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Weiter = GUICtrlCreateButton("Angaben speichern", 100, 370, 120, 25)
    $Abbrechen = GUICtrlCreateButton("Abbrechen", 220, 370, 80, 25)
    GUIStartGroup()
    $aRadio[0] = GUICtrlCreateRadio("Fehlermeldung", 10, 40)
    $aRadio[1] = GUICtrlCreateRadio("Abstürze", 10, 60)
    $aRadio[2] = GUICtrlCreateRadio("Komische Meldung", 140, 40)
    $aRadio[3] = GUICtrlCreateRadio("Seltsames Verhalten", 140, 60)
    $aRadio[4] = GUICtrlCreateRadio("Frage", 140, 80)
    GUISetState()

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

    While 1
    Switch GUIGetMsg()
    Case $GUI_EVENT_CLOSE
    MsgBox(0, "You clicked on", "Close")
    Exit
    Case $Abbrechen
    MsgBox(0, "You clicked on", "Exit")
    Exit
    Case $Weiter
    For $i = 0 To UBound($aRadio) - 1
    If BitAND(GUICtrlRead($aRadio[$i]), $GUI_CHECKED) Then $T = $i + 1
    Next
    Switch $T
    Case 1
    MsgBox(0, "TEST", "1")
    Case 2
    MsgBox(0, "TEST", "2")
    Case 3
    MsgBox(0, "TEST", "3")
    Case 4
    MsgBox(0, "TEST", "4")
    Case 5
    MsgBox(0, "TEST", "5")
    Case Else
    MsgBox(0, "TEST", "FEHLER !")
    EndSwitch
    EndSwitch
    WEnd

    [/autoit]

    Zu deinem Script: 1. kommst du nicht aus der Endlosschleife raus ohne Exitloop, 2. mehrere If-ElseIf-ElseIf-... macht man mit einem Switch oder Select und 3. Lies dir mal die Hilfe durch.

    Edit: Oder halt so wie name22 sagt:

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>

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

    Global $aRadio[5]

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

    $hGui = GUICreate("Error-Reporting")
    GUICtrlCreateLabel("Bitte wählen sie die Gruppe aus, in die ihr Problem am besten passt.", 7, 4)
    GUICtrlCreateGroup("Fehler", 7, 25, 120, 60)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    GUICtrlCreateGroup("Anderes Problem", 130, 25, 130, 85)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Weiter = GUICtrlCreateButton("Angaben speichern", 100, 370, 120, 25)
    $Abbrechen = GUICtrlCreateButton("Abbrechen", 220, 370, 80, 25)
    GUIStartGroup()
    $aRadio[0] = GUICtrlCreateRadio("Fehlermeldung", 10, 40)
    $aRadio[1] = GUICtrlCreateRadio("Abstürze", 10, 60)
    $aRadio[2] = GUICtrlCreateRadio("Komische Meldung", 140, 40)
    $aRadio[3] = GUICtrlCreateRadio("Seltsames Verhalten", 140, 60)
    $aRadio[4] = GUICtrlCreateRadio("Frage", 140, 80)
    GUISetState()

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

    While 1
    Switch GUIGetMsg()
    Case $GUI_EVENT_CLOSE
    MsgBox(0, "You clicked on", "Close")
    Exit
    Case $Abbrechen
    MsgBox(0, "You clicked on", "Exit")
    Exit
    Case $Weiter
    For $i = 0 To UBound($aRadio) - 1
    If BitAND(GUICtrlRead($aRadio[$i]), $GUI_CHECKED) Then $T = $i + 1
    Next
    GUIDelete()
    ExitLoop
    EndSwitch
    WEnd

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

    Switch $T
    Case 1
    MsgBox(0, "TEST", "1")
    Case 2
    MsgBox(0, "TEST", "2")
    Case 3
    MsgBox(0, "TEST", "3")
    Case 4
    MsgBox(0, "TEST", "4")
    Case 5
    MsgBox(0, "TEST", "5")
    Case Else
    MsgBox(0, "TEST", "FEHLER !")
    EndSwitch

    [/autoit]