Parameter: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "[[Script (File)|" to "[[Script File|") |
Lou Montana (talk | contribs) m (Text replacement - "<tt>([a-zA-Z0-9\. _"\\']+)<\/tt>" to "{{hl|$1}}") |
||
Line 1: | Line 1: | ||
A '''parameter''' is a value that ''was passed'' to the actual [[Script File|script]]. All parameters are accessible over the array | A '''parameter''' is a value that ''was passed'' to the actual [[Script File|script]]. All parameters are accessible over the array {{hl|_this}}. | ||
Line 11: | Line 11: | ||
[[params]] ["_number","_string"]; | [[params]] ["_number","_string"]; | ||
{{hl|_number}} and {{hl|_string}} are considered the parameters of the script, and are filled with the values that were provided in the array. {{hl|_number}} now contains the value '''5''', while _string now contains the value '''string'''. | |||
== See also == | == See also == |
Revision as of 23:55, 15 November 2021
A parameter is a value that was passed to the actual script. All parameters are accessible over the array _this.
Example:
[5, "string"] execVM "script.sqf"
script.sqf
params ["_number","_string"];
_number and _string are considered the parameters of the script, and are filled with the values that were provided in the array. _number now contains the value 5, while _string now contains the value string.