Argument: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (Some wiki formatting)
 
(7 intermediate revisions by 4 users not shown)
Line 1: Line 1:
An '''argument''' is any value that ''is being passed'' to a [[:Category: Scripting Commands|scripting command]] or an executed [[Script (File)|script]] or [[Function|function]]. In the script or function this value is considered a [[Parameter|parameter]].
An '''argument''' is any value that ''is being passed'' to a [[:Category: Scripting Commands|scripting command]] or an executed [[Script File|script]] or [[Function|function]]. In the script or function this value is considered a [[Parameter|parameter]].




'''Example:'''
'''Example:'''


[variable, 5, "string"] [[execVM]] "myScript.sqf"
<sqf>[variable, 5, "string"] execVM "myScript.sqf"</sqf>


<tt>variable</tt>, <tt>5</tt> and <tt>"string"</tt> are called the arguments given to the script. You could even go as far to call the [[Array]] containing these values the single argument.
The [[Array]] {{hl|[variable, 5, "string"]}} and the contained values are called the arguments given to the script.


== Access ==
== Access ==


In the script the argument can be accessed using the magic variable <tt>_this</tt>.
In the script the argument can be accessed using the [[Magic Variables|magic variable]] {{hl|_this}}.


== See also ==
== See also ==
Line 16: Line 16:
* [[Parameter]]
* [[Parameter]]


[[Category: ArmA: Scripting]]
[[Category:Syntax]]
[[Category: Scripting Topics]]

Latest revision as of 00:40, 22 July 2022

An argument is any value that is being passed to a scripting command or an executed script or function. In the script or function this value is considered a parameter.


Example:

[variable, 5, "string"] execVM "myScript.sqf"

The Array [variable, 5, "string"] and the contained values are called the arguments given to the script.

Access

In the script the argument can be accessed using the magic variable _this.

See also