set: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(see also)
mNo edit summary
Line 44: Line 44:
<h3 style="display:none">Bottom Section</h3>
<h3 style="display:none">Bottom Section</h3>
[[Category:Scripting Commands|SET]]
[[Category:Scripting Commands|SET]]
[[Category:Scripting Commands OFP 1.99|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands OFP 1.96|SET]]
[[Category:Scripting Commands OFP 1.96|SET]]
[[Category:Scripting Commands ArmA|SET]]
[[Category:Scripting Commands ArmA|SET]]

Revision as of 12:08, 25 September 2014

Hover & click on the images for description

Description

Description:
Changes the element at the given (zero-based) index of the array.
If the element does not exist, resize index+1 is called to create it.
Groups:
Uncategorised

Syntax

Syntax:
array set [index, value]
Parameters:
array: Array
[index, value]: Array
index: Number
value: Anything
Return Value:
Nothing

Examples

Example 1:
_arrayOne set [0, "Hello"];
Example 2:
_arrayTwo set [count _arrayTwo, "Bye"]; appends "Bye" as last element to _arrayTwo
Example 3:
_arrayThree set [(count _arrayThree) - 1, 23]; replaces the last element of _arrayTwo with 23

Additional Information

See also:
Arrayplus avaluea plus valueba - bresizereverseselectinfindtoArraytoStringforEachcountpushBackdeleteAtdeleteRange

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