Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Variable Scope Issues

$
0
0

I have been at this for over an hour and can't see anything wrong with the code...I have global variables declared yet variables WILL NOT UPDATE.

 

Any ideas guys?

 

AutoIt         
#include <GUIConstantsEx.au3> #include <SliderConstants.au3> #include <WindowsConstants.au3> #include <GuiSlider.au3> #include <Timers.au3> #Region ### START Koda GUI section ### Form= Global $SlideVal = 0, $Timer = _Timer_Init() $Form1 = GUICreate("Form1", 128, 600) $Slider1 = GUICtrlCreateSlider(32-8, 0, 128, 600, BitOR($TBS_VERT,$TBS_TOP,$TBS_LEFT,$TBS_BOTH,$TBS_FIXEDLENGTH)) GUICtrlSetResizing(-1, $GUI_DOCKHCENTER+$GUI_DOCKVCENTER) ;GUIRegisterMsg($WM_NOTIFY, "MY_WM_COMMAND") ;GUIRegisterMsg($WM_NOTIFY, "MY_WM_COMMAND") GUISetState(@SW_SHOW) _GUICtrlSlider_SetThumbLength($Slider1, 64) ;Assign("SlideVal",GuiCtrlRead($Slider1),2) #EndRegion ### END Koda GUI section ### While 1     $nMsg = GUIGetMsg()     Switch $nMsg         Case $GUI_EVENT_CLOSE             Exit     EndSwitch     If NOT GUICtrlRead($Slider1) = $SlideVal Then         $Elapsed = _Timer_Diff($Timer)             ConsoleWrite($Elapsed&"|"&$SlideVal&"|"&GUICtrlRead($Slider1)&@CRLF)         If $Elapsed < 500 Then             ConsoleWrite($Elapsed&"|"&$SlideVal&"|"&GUICtrlRead($Slider1)&@CRLF)             $Timer = _Timer_Init()         ElseIf _Timer_Diff($Timer) = _Timer_Diff("") OR _Timer_Diff($Timer) > 1000 Then             ConsoleWrite($Elapsed&"|"&$SlideVal&"|"&GUICtrlRead($Slider1)&@CRLF)             $Timer = _Timer_Init()         EndIf         $SlideVal = GUICtrlRead($Slider1)     EndIf WEnd

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>