Hallo Raupi,
habe das mal so eingebaut.
Der Ablauf ist soweit in Ordnung.
Wie kann ich aber den Loop vorzeitig beenden?
Habe ExitLoop eingebaut, das geht aber leider nicht!
[autoit]
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("Form1", 438, 89, 192, 132)
$Loop = GUICtrlCreateButton("Loop-Start", 32, 24, 179, 49)
$Loopinfo = GUICtrlCreateButton("Info", 240, 24, 179, 49)
GUISetState(@SW_SHOW)
Global $i500 = 500
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Loop
Page()
Case $Loopinfo
info()
EndSwitch
WEnd
Func Page()
[/autoit][autoit][/autoit][autoit]For $i = 1 To 10
ConsoleWrite($i & @CRLF)
_MySleep($i500)
Next
EndFunc ;==>Page
[/autoit][autoit][/autoit][autoit]Func info()
[/autoit][autoit][/autoit][autoit]MsgBox(0, "", "test", 1)
;ExitLoop
EndFunc ;==>info
[/autoit][autoit][/autoit][autoit]Func _MySleep($iMSec)
Local $nMsg, $dt = TimerInit()
Do
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Loopinfo
info()
ExitLoop ; Loop verlassen klappt leider nicht!
EndSwitch
Sleep(10)
Until TimerDiff($dt) > $iMSec
EndFunc ;==>_MySleep
Grüße
Ilse