longtimer
From Free Pascal wiki
LongTimer
Summary
- The Tlongtimer component is a descendent of TIdleTimer component, and shares its properties and methods.
- Additional properties affect when the OnTimer event is fired.
- With LongTimer, the OnTimer event is fired only once - every time the interval you set is reached.
Properties
- Enumerated types
- IntervalType = (lt1Daily,lt2Weekly,lt3Monthly)
- WeeklyDay = (lt1Monday,lt2Tuesday,lt3Wednesday,lt4Thursday,lt5Friday,lt6Saturday,lt7Sunday)
- SampleInterval = (lt1Everyminute,lt2Every5minutes,lt3Every10Minutes,lt4Every30Minutes,lt5Every45Minutes)
- Others
- Daily24Hour - 0 = Midnight, 1 = 1am ... 14 = 2pm etc.
- MonthlyDate - 1 = 1st, 2 = 2nd etc.
Methods
- The OnTimer event will only fire according to the above properties
- To fire the Ontimer every day at approx. 10am
LongTimer1.IntervalType:=lt1Daily;
LongTimer1.Daily24Hour:=10;
LongTimer1.Enabled:=TRUE;
- To fire the Ontimer on the last day of every month at approx. 10am
LongTimer1.IntervalType:=lt3Monthly;
LongTimer1.MonthlyDate:=31;
LongTimer1.Daily24Hour:=10;
LongTimer1.Enabled:=TRUE;
Note that if a month has less than 31 days, LongTimer will automatically compensate
Download
- Download the TlongTimer component from the Lazarus CCR Repository