scriptDone: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (formatted notes)
m (template:command argument fix)
Line 7: Line 7:
____________________________________________________________________________________________
____________________________________________________________________________________________


| Check if a script is finished running using the [[Script_(Handle)]] returned by [[execVM]] or [[spawn]]. |= Description
| Check if a script is finished running using the [[Script_(Handle)]] returned by [[execVM]] or [[spawn]]. |DESCRIPTION=
____________________________________________________________________________________________
____________________________________________________________________________________________


| '''scriptDone''' handle |= Syntax
| '''scriptDone''' handle |SYNTAX=


|p1= handle: [[Script_(Handle)]] returned by [[spawn]] or [[execVM]] |= Parameter 1
|p1= handle: [[Script_(Handle)]] returned by [[spawn]] or [[execVM]] |PARAMETER1=


| [[Boolean]] |= Return value
| [[Boolean]] |RETURNVALUE=
____________________________________________________________________________________________
____________________________________________________________________________________________


|x1= SQS Syntax:<code>@[[scriptDone]] _Handle</code> |= Example 1
|x1= SQS Syntax:<code>@[[scriptDone]] _Handle</code> |EXAMPLE1=
____________________________________________________________________________________________
____________________________________________________________________________________________


|x2= SQF Syntax:<code>script_handler = [parameters] [[execVM]] "scriptname.sqf";
|x2= SQF Syntax:<code>script_handler = [parameters] [[execVM]] "scriptname.sqf";
[[waitUntil]] { [[scriptDone]] script_handler };</code> |= Example 2
[[waitUntil]] { [[scriptDone]] script_handler };</code> |EXAMPLE2=
____________________________________________________________________________________________
____________________________________________________________________________________________


| [[execVM]], [[spawn]], [[terminate]], [[scriptNull]]|= See also
| [[execVM]], [[spawn]], [[terminate]], [[scriptNull]]|SEEALSO=


}}
}}

Revision as of 15:46, 7 April 2019

-wrong parameter ("Arma") defined!-1.00
Hover & click on the images for description

Description

Description:
Check if a script is finished running using the Script_(Handle) returned by execVM or spawn.
Groups:
Uncategorised

Syntax

Syntax:
scriptDone handle
Parameters:
handle: Script_(Handle) returned by spawn or execVM
Return Value:
Boolean

Examples

Example 1:
SQS Syntax:@scriptDone _Handle
Example 2:
SQF Syntax:script_handler = [parameters] execVM "scriptname.sqf"; waitUntil { scriptDone script_handler };

Additional Information

See also:
execVMspawnterminatescriptNull

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

Notes

Posted on 03:54, 11 September 2009
Bn880
A Null Script handle can be created in this manner: _handle = 0 spawn {}; That is what any Script_(Handle) becomes when a script is finished running, meaning it will test as true with: scriptDone _handle and it returns "<NULL-script>" when converted to string. This in turn lets you initialize the variable with a completed Script_(Handle) and lets you test the variable even though nothing else may have set the handle by creating a script with spawn or execVM. It also lets you store and manage script handles in arrays, and a few other sexy things.

Bottom Section