'Similar to CallSubDelayed. This method allows you to set the delay (in milliseconds).
'Note that the sub name must include an underscore if compiled with obfuscation enabled.
Public Sub CallSubDelayedPlus(Module As Object, SubName As String, Delay As Int) As Timer
Return CallSubDelayedPlus2(Module, SubName, Delay, Null)
End Sub
'Similar to CallSubDelayed. This method allows you to set the delay (in milliseconds).
'Note that the sub name must include an underscore if compiled with obfuscation enabled.
'The target sub should have one parameter with a type of Object().
Public Sub CallSubDelayedPlus2(Module As Object, SubName As String, Delay As Int, Arg() As Object) As Timer
Return PlusImpl(Module, SubName, Delay, Arg, True)
End Sub
'Similar to CallSub. This method allows you to set the delay (in milliseconds).
'Note that the sub name must include an underscore if compiled with obfuscation enabled.
Public Sub CallSubPlus(Module As Object, SubName As String, Delay As Int) As Timer
Return CallSubPlus2(Module, SubName, Delay, Null)
End Sub
'Similar to CallSub. This method allows you to set the delay (in milliseconds).
'Note that the sub name must include an underscore if compiled with obfuscation enabled.
'The target sub should have one parameter with a type of Object().
Public Sub CallSubPlus2(Module As Object, SubName As String, Delay As Int, Arg() As Object) As Timer
Return PlusImpl(Module, SubName, Delay, Arg, False)
End Sub
Public Sub cancelDelay(tmr As Timer)
tmr.Enabled=False
RunDelayed.Remove(tmr)
End Sub
Private Sub PlusImpl(Module As Object, SubName As String, Delay As Int, Arg() As Object, delayed As Boolean) As Timer
If RunDelayed.IsInitialized = False Then RunDelayed.Initialize
Dim tmr As Timer
tmr.Initialize("tmr", Delay)
Dim rdd As RunDelayedData
rdd.Module = Module
rdd.SubName = SubName
rdd.Arg = Arg
rdd.delayed = delayed
RunDelayed.Put(tmr, rdd)
tmr.Enabled = True
Return tmr
End Sub