Difference between revisions of "ISDBApplication::CreateTimer"

From MediaMonkey Wiki
Jump to: navigation, search
(Example code)
Line 11: Line 11:
  
 
===Example code===                     
 
===Example code===                     
<source lang="vb">Set Tmr = SDB.CreateTimer( 10000)  ' Pop up a message in 10 seconds
+
<source lang="vb">
  Script.RegisterEvent Tmr, "OnTimer", "TestTimer"
+
Set Tmr = SDB.CreateTimer( 10000)  ' Pop up a message in 10 seconds
 +
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}}]]

Revision as of 19:05, 30 March 2007

CoClass SDBApplication, Interface ISDBApplication

Function CreateTimer(Interval As Long) As ISDBTimer


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