exec: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
mNo edit summary
Line 1: Line 1:
[[Category:Scripting Commands|EXEC]]
{{Command|= Comments
[[Category:Scripting Commands OFP 1.96|EXEC]]
____________________________________________________________________________________________
[[Category:Scripting Commands OFP 1.46|EXEC]]
[[Category:Scripting Commands ArmA|EXEC]]


| ofp |= Game name


<h2 style="color:#000066"> '''''argument'' exec ''script'''''</h2>
|1.00|= Game version


|arg= global |= Arguments in MP


'''Operand types:'''
|eff= local |= Effects in MP
____________________________________________________________________________________________


'''argument:''' [[Any Value]]
| Execute a script. The argument is passed to the script in the "_this" variable. Learn more about scripts under [[Scripts]]. |= Description
____________________________________________________________________________________________


'''script:''' [[String]]
| argument '''exec''' fileName |= Syntax


'''Type of returned value:'''
|p1= argument: [[Any Value]] - the argument which should be passed to the script. To pass multiple arguments, use an array. |= Parameter 1


[[Nothing]]
|p2= fileName: [[String]] - the name of the script. It should be given relatively to the mission folder, campaign scripts subfolder or global scripts folder and is searched there in the same order. If you refer to a script packed together with an addon, the path should look like this: "\ADDON_PBO_NAME\script.sqs" where ADDON_PBO_NAME is the name of the addon's *.pbo file without extension. |= Parameter 2


'''Description:'''
| [[Nothing]] |= Return value
____________________________________________________________________________________________
 
|x1= <pre>[player, jeep] exec "getin.sqs"</pre> |= Example 1
____________________________________________________________________________________________


Execute script.
| [[call]] |= See also


Argument is passed to script as local variable '''_this'''.
}}


Script is first searched for in mission folder, then in campaign scripts subfolder, lastly in global scripts folder.
<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->


<!-- Note Section END -->
</dl>


'''Example:'''
<h3 style="display:none">Bottom Section</h3>


[ [[player]], jeepOne] '''exec''' "getIn.sqs"
[[Category:Scripting Commands|EXEC]]
[[Category:Scripting Commands OFP 1.96|EXEC]]
[[Category:Scripting Commands OFP 1.46|EXEC]]
[[Category:Scripting Commands ArmA|EXEC]]

Revision as of 11:09, 2 August 2006

Hover & click on the images for description

Description

Description:
Execute a script. The argument is passed to the script in the "_this" variable. Learn more about scripts under Scripts.
Groups:
Uncategorised

Syntax

Syntax:
argument exec fileName
Parameters:
argument: Any Value - the argument which should be passed to the script. To pass multiple arguments, use an array.
fileName: String - the name of the script. It should be given relatively to the mission folder, campaign scripts subfolder or global scripts folder and is searched there in the same order. If you refer to a script packed together with an addon, the path should look like this: "\ADDON_PBO_NAME\script.sqs" where ADDON_PBO_NAME is the name of the addon's *.pbo file without extension.
Return Value:
Nothing

Examples

Example 1:
[player, jeep] exec "getin.sqs"

Additional Information

See also:
call

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

Bottom Section