Jump to content

Recommended Posts

Posted (edited)

When I tested the timer, I noticed it will pick up where it left off even after I reset it. I read the instructions that were provided to me, but I'm not sure how to code it. :P

I need the timer to reset when the reset button is pushed, and the clock start @ 0. Currently, it will pick up right where the first time the start button was pushed, along with any time that has passed.

To put it simply, I need it to :

start - starts the timer

stop - stops the timer

start - (right where I stopped it : if it shows 6 seconds, when I restart, it will start from 6 seconds, then 7 seconds...- just like a real stop watch)

reset - resets everything back to 0 so the timer can be used again fresh.

I hate being a nag on this, but could someone please take pity on me? I've been staring at this code for a hour, and for the life of me, I'm just confused.... :lmao:

For $xk = 1 To $count
        If $msg = $TButton_[$xk] And GUICtrlRead($Input_[$xk]) > "" Then
            GUICtrlSetState($TButton_[$xk], $GUI_DISABLE)
            GUICtrlSetState($Input_[$xk], $GUI_DISABLE)
            $TimerActive_[$xk] = 1
            If Not StringLen(String($Timer_[$xk])) Then $Timer_[$xk] = TimerInit()
        ElseIf $msg = $TButton_[$xk] Then
            MsgBox(64, "User Error", "Please Type in a Ticket Number   ", 3)
        EndIf
        If $msg = $SButton_[$xk] And GUICtrlRead($SButton_[$xk]) = "Reset" Then
            GUICtrlSetData($Label_[$xk], "00:00:00")
            GUICtrlSetData($Input_[$xk], "")
            GUICtrlSetData($SButton_[$xk], "Stop")
        EndIf
        If $msg = $SButton_[$xk] And GUICtrlRead($Input_[$xk]) > "" And GUICtrlRead($SButton_[$xk]) = "Stop" Then
            $TimerActive_[$xk] = 0
            GUICtrlSetData($SButton_[$xk], "Reset")
            GUICtrlSetState($TButton_[$xk], $GUI_ENABLE)
            GUICtrlSetState($Input_[$xk], $GUI_ENABLE)
     ;
            GUICtrlSetBkColor($Label_[$xk], 0xD4D0C8)
            $Name = GUICtrlRead($Input_[$xk])
     ;
            If $xk < 5 Then
                $Unit = $Header_1 & "  " & $xk
            EndIf

        EndIf
        
        If $xk = 5 Then ExitLoop 
      
    Next
Edited by vollyman

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...