Modify

Opened 15 years ago

Closed 15 years ago

#1907 closed Bug (Duplicate)

Bug in AdlibRegister

Reported by: claudio.veronesi@… Owned by:
Milestone: Component: AutoIt
Version: 3.3.6.1 Severity: None
Keywords: Cc:

Description

I think, there is a bug in AdlibRegister.
I Register a function for every 5 seconds.

The duration of this function is 4 seconds. At the beginning, I Unregister the Adlib Timer. At the end, I register it again with 5 seconds.

But then only one second later, this function is called again!

{{{{
AdlibRegister("test", 5000)
HotKeySet("{ESC}")

While 1

Sleep(5000)

WEnd
Exit

Func test()

AdlibUnRegister("test")
ToolTip("Function")
Sleep(4000)
ToolTip("")
AdlibRegister("test", 5000)
Return 1

EndFunc ;==>test
}}}}

Attachments (0)

Change History (2)

comment:1 by mvg, 15 years ago

Think your right.
Might already be solved with/by #1633 (Milestone: 3.3.7.0)

Output on code below ... (comment).

[0] AdlibRegister
AdlibUnRegister ... (*1, Adlib return call)
[timer] 1005.84180391642
AdlibRegister ... (*2, set to 500)
[timer] 200.836139788716 ... (200, delay between *1 and *2)
AdlibUnRegister
[timer] 304.726159330306 ... (300, Adlib return call, should probably be 500. yes?)
AdlibRegister
[timer] 203.148165479132
AdlibUnRegister
[timer] 297.781980670728
AdlibRegister
[timer] 208.376762968478
AdlibUnRegister
[timer] 296.342412233957
HotKeySet("{ESC}")

DebugOut('[0] AdlibRegister') ;### Debug DebugOut.
AdlibRegister("test", 10 * 100)
Global $iTimer = TimerInit()

While 1
	Sleep(250)
WEnd
Exit

Func test()
	Static $iBailout = 2

	DebugOut('AdlibUnRegister') ;### Debug DebugOut.
	DebugOut('[timer] ' & TimerDiff($iTimer)) ;### Debug DebugOut.
	AdlibUnRegister()
	$iTimer = TimerInit()

	if $iBailout < 0 Then Exit
	$iBailout -= 1

	Sleep(2 * 100)

	DebugOut('AdlibRegister') ;### Debug DebugOut.
	DebugOut('[timer] ' & TimerDiff($iTimer)) ;### Debug DebugOut.
	AdlibRegister("test", 5 * 100)
	$iTimer = TimerInit()
EndFunc
Func DebugOut($sMsg)
	ConsoleWrite($sMsg & @CRLF)
EndFunc

comment:2 by Jon, 15 years ago

Resolution: Duplicate
Status: newclosed

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.