Page 1 of 1

ChangeInterval() and GetAttribute()

Posted: Wed Jan 08, 2025 3:25 pm
by Flinx
If you change an interval frequency using ChangeInterval(), GetAttribute(#INTERVAL, id, #ATTRDURATION) keeps returning the initially selected value.
And by the way, the manual entries of ChangeInterval( ) and GetAttribute() refer to a frequency in milliseconds, but that's not precise, as it is the period.

Code: Select all

Function p_Main()
	Print(".")
EndFunction

SetInterval(1, p_Main, 1000)
GetAttribute(#INTERVAL, 1, #ATTRDURATION)
DebugPrint("Period:",GetAttribute(#INTERVAL, 1, #ATTRDURATION))
ChangeInterval(1,  5000)
Repeat
	DebugPrint("Period:",GetAttribute(#INTERVAL, 1, #ATTRDURATION))
	WaitEvent()
Forever

Re: ChangeInterval() and GetAttribute()

Posted: Sun Jan 12, 2025 10:33 pm
by airsoftsoftwair
Clearly a bug, will be fixed, thanks for reporting!

Re: ChangeInterval() and GetAttribute()

Posted: Sun May 18, 2025 5:59 pm
by airsoftsoftwair

Code: Select all

- Fix: #ATTRDURATION for object type #INTERVAL always returned the initial interval time even after a call
  to ChangeInterval()