Can an empty process globals array of Timers be used and add new timers to it this way?
(In the example I don't use EventName; I would use it "later". Also "n"... just an example)
A private object (tmr in AddTimer) added to a global array, uhm... thinking...
ArrTimers will store references to timer objects, which are initiliazed as private.
Well, I don't know; this is the reason for this question
Also, I would prefer to use a Map to store the timers, but this could be even worse, I think.
B4X:
Sub Process_Globals
Privare arrTimers(20) As Timer
End Sub
Public Sub AddTimer(EventName As String, Interval As Int)
Dim tmr As Timer
tmr.Initialize("tmr", Interval)
arrTimers(n) = tmr
End Sub
A private object (tmr in AddTimer) added to a global array, uhm... thinking...
ArrTimers will store references to timer objects, which are initiliazed as private.
Well, I don't know; this is the reason for this question
Also, I would prefer to use a Map to store the timers, but this could be even worse, I think.