Hi leute, bin neu bei autoit und probiere gerade ien bissechen mit dem Gui rum. bisher konnte ich mir viel aus der doku erlesen aba hänge jetzt leider trotz dem. ich will ein programm mit einem start und einem stop button schreiben. beim startbutton wird eine endlosschleife aufgerufen die ich aba mit dem stop button ohne zeitverzögerung beenen will... hab schon bisel rumproiert aba bisher war meine einzigste lösung das ich den stop button über ne prüfung in die endlosschleife eifüge und das nach jeder handlung... das is ziemlich doof und ich hab immer nch ne zeitverzögerung drinne... manchmal von 10-15 sec. wisst ihr vielleicht ne lösung wie ich über nen button ne aktive endlosschleife sofort beenden kann?
hier ma nen beispiel mit nem count...
[autoit]#include <GUIConstants.au3>
Global $Counter
Global $Add
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 203, 91, 193, 125)
$Label1 = GUICtrlCreateLabel("Label1", 12, 8, 174, 40, $SS_CENTER)
GUICtrlSetFont(-1, 20, 800, 0, "Arial Black")
$Start = GUICtrlCreateButton("Start", 16, 56, 75, 25, 0)
$Stop = GUICtrlCreateButton("Stop", 104, 56, 75, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Func _Add()
Do
$Add = $Add + 1
GUICtrlSetData ( $Label1, $Add)
Sleep(150)
Until $Counter = 0
EndFunc
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Start
$Counter = 1
_Add()
Case $Stop
$Counter = 0
MsgBox(0, "Stop", "Zähler wurde Angehalten.")
EndSwitch
WEnd
das mit dem counter is mir gerade eingefallen aba bringt ach nix... der zähler läufft weiter wenn ich stop drücke...