oTimerVariable receiving the timer.
AdvPL GuideDEFINE TIMER oTimer INTERVAL nInterval ACTION uActionDefines a periodic interface action.
Historical DEFINE TIMER in RWMAKE2.CH expands INTERVAL and ACTION into TTimer():New; ACTIVATE TIMER is separate. That community 2012 include establishes its own expansion rather than universal availability in current includes. TTimer documentation confirms milliseconds and interface ownership. This example only defines an inactive timer; it demonstrates neither JOB execution nor clock precision. Real use requires owner and shutdown deactivation checks. (EURAI, 2012, ref. 1; TOTVS, n.d., ref. 2)
DEFINE TIMER oTimer INTERVAL nInterval ACTION uActionoTimerVariable receiving the timer.
nIntervalInterval in milliseconds.
uActionAction expression wrapped by the command.
Command without a function return.
#Include "Protheus.ch"
User Function Ed348()
Local oTimer
// Definition only: no activation in this example.
DEFINE TIMER oTimer INTERVAL 2000 ACTION ConOut("Test tick")
Return NilTimer defined without ticks; the macro must exist in the environment include. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.
© 2026 Usina.BR. All rights reserved. TOTVS, Protheus, Microsiga and their respective logos are trademarks of their owners. AdvPL Guide is independent and uses limited, attributed excerpts justified by educational purposes. See the Terms of Use. Terms of Use
Comments
There are no approved comments yet.
Sign in with Google or Microsoft to comment.