ISDBApplication::CreateTimer: Difference between revisions

From MediaMonkey Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==[[SDBApplication#ISDBApplication_members|ISDBApplication]]::CreateTimer==
{{MethodDeclaration|SDBApplication|ISDBApplication|Function CreateTimer(Interval As Long) As [[SDBTimer]]}}
 
''Function CreateTimer(Interval As Long) As ISDBTimer''
 


===Parameters===
===Parameters===


{{MethodParameters
{{MethodParameters  
   
  |Interval |Long |Interval between calls (in milliseconds).}}
|Interval |Long |Interval between calls (in milliseconds).}}


===Method description===
===Method description===


Creates new timer.
Creates new timer.


 
===Example code===                  
===Example code===
<source lang="vb">
<source lang="vb">Set Tmr = SDB.CreateTimer( 10000)  ' Pop up a message in 10 seconds
Set Tmr = SDB.CreateTimer( 10000)  ' Pop up a message in 10 seconds
  Script.RegisterEvent Tmr, "OnTimer", "TestTimer"
Script.RegisterEvent Tmr, "OnTimer", "TestTimer"


Sub TestTimer( Timer)
Sub TestTimer( Timer)
   SDB.MessageBox "10 seconds elapsed!", mtInformation, Array(mbOk)
   SDB.MessageBox "10 seconds elapsed!", mtInformation, Array(mbOk)
   Script.UnregisterEvents Timer  ' Terminate usage of this timer
   Script.UnregisterEvents Timer  ' Terminate usage of this timer
End Sub</source>
End Sub
</source>


[[Category:Scripting|{{PAGENAME}}]]
[[Category:Scripting|{{PAGENAME}}]]

Latest revision as of 22:20, 5 March 2008

CoClass SDBApplication, Interface ISDBApplication

Function CreateTimer(Interval As Long) As SDBTimer


Parameters

Name Type Description
Interval Long Interval between calls (in milliseconds).


Method description

Creates new timer.

Example code

Set Tmr = SDB.CreateTimer( 10000)   ' Pop up a message in 10 seconds
Script.RegisterEvent Tmr, "OnTimer", "TestTimer"

Sub TestTimer( Timer)
  SDB.MessageBox "10 seconds elapsed!", mtInformation, Array(mbOk)
  Script.UnregisterEvents Timer  ' Terminate usage of this timer
End Sub