Glyph Posted June 3, 2007 Posted June 3, 2007 func _Timeout() $szIPADDRESS = @IPAddress1 $nPORT = 1337 $MainSocket = TCPListen($szIPADDRESS, $nPORT) $nTimer = TimerInit() Do $nDiff = TimerDiff($nTimer)/int(1000) $ConnectedSocket = TCPAccept($MainSocket) if $ndiff = int(1-10) Then GUICtrlSetData($cont1,"Timeout in 10 Seconds. "&int($ndiff)&" seconds have passed.") EndIf Until $ConnectedSocket <> -1 or int($ndiff) >= "10" EndFunc i cant think of anything that would make it show whole numbers one by one isntead of the whole unnecessary flickering, i searched for similiar problems but nothing like this one... tolle indicium
MHz Posted June 3, 2007 Posted June 3, 2007 (edited) Update only when needed with a condition. Func _Timeout() Local $time_previous, $time_now $szIPADDRESS = @IPAddress1 $nPORT = 1337 $MainSocket = TCPListen($szIPADDRESS, $nPORT) $nTimer = TimerInit() Do $time_now = Int(TimerDiff($nTimer) / 1000) $ConnectedSocket = TCPAccept($MainSocket) If $time_now <= 10 And $time_now <> $time_previous Then GUICtrlSetData($cont1, "Timeout in 10 Seconds. " & $time_now & " seconds have passed.") $time_previous = $time_now ; Moved to here EndIf Until $ConnectedSocket <> -1 Or $time_now >= 10 EndFunc ;==>_Timeout Edit: Updated code. Edited June 3, 2007 by MHz
Glyph Posted June 3, 2007 Author Posted June 3, 2007 oo, thanks! i see now, i was trying it a different way obviously tolle indicium
MHz Posted June 3, 2007 Posted June 3, 2007 oo, thanks!i see now, i was trying it a different way obviously I am sure I made a mistake and corrected in my previous post. The $time_previous variable should only update within the If block.
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