SetTimeout: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
Brendon (talk | contribs)
Created page with "SETTIMEOUT (''function'', ''milliseconds'') '''Description''' SETTIMEOUT is used to schedule an event for a future time, where function is the name of the SUB or FUNCTION to..."
 
Brendon (talk | contribs)
No edit summary
Line 1: Line 1:
SETTIMEOUT (''function'', ''milliseconds'')
SetTimeOut (''function'', ''milliseconds'')


'''Description'''
== Description ==


SETTIMEOUT is used to schedule an event for a future time, where function is the name of the SUB or FUNCTION to be called, and milliseconds is how long in the future it is to be called. Execution does not halt at this statement – it continues with the next statement. It returns a reference to the timeout action which can be used in CLEARTIMEOUT.
SetTimeOut is used to schedule an event for a future time, where function is the name of the Sub or Function to be called, and milliseconds is how long in the future it is to be called. Execution does not halt at this statement – it continues with the next statement. It returns a reference to the timeout action which can be used in ClearTimeOut.


'''Example'''
== Example ==


<pre>
<pre>
Line 16: Line 16:
</pre>
</pre>


'''Output'''
== Output ==


<pre>
<pre>
Line 25: Line 25:
</pre>
</pre>


'''Related Items'''
== Related Items ==


[[clearinterval|CLEARINTERVAL]], [[cleartimeout|CLEARTIMEOUT]], [[setinterval|SETINTERVAL]]
[[clearinterval|CLEARINTERVAL]], [[cleartimeout|CLEARTIMEOUT]], [[setinterval|SETINTERVAL]]
[[Category:Language Reference]]

Revision as of 03:14, 17 August 2012

SetTimeOut (function, milliseconds)

Description

SetTimeOut is used to schedule an event for a future time, where function is the name of the Sub or Function to be called, and milliseconds is how long in the future it is to be called. Execution does not halt at this statement – it continues with the next statement. It returns a reference to the timeout action which can be used in ClearTimeOut.

Example

Rem SetTimeout statement
T=setTimeout(nextAction,3000)
 
Function nextAction()
  msgbox "nextAction"
end function

Output




nextAction appears 3 seconds later

Related Items

CLEARINTERVAL, CLEARTIMEOUT, SETINTERVAL