Hello,
i have been making a countdown timer and its all working just how i like it, its just skipping the 0's en going from 1 - 59 ( it does wait the time needed for the counter to go from 1 - 0 - 59) It just goes from 1 to 59, showing the 1 for the time needed to go from 1 to 0 and then to 59.
Here's my code:
For $i = 60 To 1 Step -1
Next
If $i = 0 Then
$Sc = $Sc - 1
EndIf
If $Sc = 0 Then
$Sc = 0 ;~ <--- Shouldnt this work? Setting it to 0 then wait 1 sec to set it to 59?
Sleep(1000)
$Mn = $Mn - 1
$Sc = 59
EndIf
If $Mn = 0 And $Sc = 0 Then
$CDHrs = 0
Sleep(1000)
$Mn = 59
EndIf
GUICtrlSetData($Countdown, 'Hrs:' & $CDHrs & ' ' & 'Min:' & $Mn & ' ' & 'Sec:' & $Sc)
Sleep(1000)
I dont need the solution in code, just point me into the general direction where i am going wrong, i'd like to learn from my mistake. Thanks in advance.
~ Maffiagang