Sign in to follow this  
Followers 0
Glyph

Flickering GUICTRLEDIT...

4 posts in this topic

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 by MHz

Share this post


Link to post
Share on other sites

oo, thanks!

i see now, i was trying it a different way obviously :)


tolle indicium

Share this post


Link to post
Share on other sites

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.

:)

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0