ssah8 0 Posted October 30, 2016 Share Posted October 30, 2016 Why does this not work in a loop? $counter = GUICtrlCreateLabel ($counter + 1, 220, 152, 127, 17) Link to post Share on other sites
ssah8 0 Posted October 30, 2016 Author Share Posted October 30, 2016 Am I allowed to ask a question as simple as this? Or does this somehow break any rules this website has? Link to post Share on other sites
AutoBert 199 Posted October 30, 2016 Share Posted October 30, 2016 This oneliner couldn't run. Link to post Share on other sites
ssah8 0 Posted October 30, 2016 Author Share Posted October 30, 2016 For $i = 1 To 10 $counter = GUICtrlCreateLabel ($counter + 1, 220, 152, 127, 17) Next Link to post Share on other sites
AutoBert 199 Posted October 30, 2016 Share Posted October 30, 2016 (edited) Also not runable, there is no GUI. Make a runable (reproducer script) for get better help. Until this learn the basics maybe this script helps: expandcollapse popup;https://autoit.de/index.php/Thread/83656-Button-Klick-erkennen-wenn-Funktion-l%C3%A4uft-so-wie-ein-Hotkey/?postID=669356#post669356 #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $gui = GUICreate("KLeines 1 X 1", 400, 130) $Start = GUICtrlCreateButton("&Start", 10, 10) $PauseResume = GUICtrlCreateButton("&Pause", 10, 40) $Label = GUICtrlCreateLabel("", 100, 70, 280, 22) $Anzeige = GUICtrlCreateLabel("", 10, 95, 380, 22) GUISetState() Global $sIPAddress While 1 _EventHandler() WEnd Func _EventHandler() $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit Case $Start GUICtrlSetState($Start, $GUI_DISABLE) For $i = 1 To 10 For $j = 1 To 10 GUICtrlSetData($Anzeige, $j & " * " & $i & " = " & $i * $j) _MySleep(500) Next Next GUICtrlSetState($Start, $GUI_ENABLE) Case $PauseResume If GUICtrlRead($PauseResume) = "&Pause" Then GUICtrlSetData($PauseResume, "&Weiter") While GUICtrlRead($PauseResume) <> "&Pause" _MySleep(50) WEnd Else GUICtrlSetData($PauseResume, "&Pause") EndIf EndSwitch EndFunc ;==>_EventHandler Func _MySleep($iMSec) Local $iStart = TimerInit() Do _EventHandler() Until TimerDiff($iStart) >= $iMSec EndFunc ;==>_MySleep Edited October 30, 2016 by AutoBert Link to post Share on other sites
ssah8 0 Posted October 30, 2016 Author Share Posted October 30, 2016 I figured it out myself. I used GUICtrlSetData. Thank you anyways. (Your code explains it aswell) Link to post Share on other sites
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now