resize: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " <h3 style="display:none">Notes</h3> <dl class="command_description"> <!-- Note Section BEGIN --> <!-- Note Section END --> </dl> " to "") |
Lou Montana (talk | contribs) m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments( \("local" or "global"\))?|Effects|Multiplayer Effects( \("local" or "global"\))?|Multiplayer Exe...) |
||
Line 3: | Line 3: | ||
{{GameCategory|arma1|Scripting Commands}} | {{GameCategory|arma1|Scripting Commands}} | ||
{{Command | {{Command | ||
| ofpr | | ofpr | ||
|1.75 | |1.75 | ||
|gr1= Arrays | |gr1= Arrays | ||
| Changes the size of the given array. The command does not return new array, it resizes the source array to the desired number of elements. If the new size is bigger than the current size, the new places are filled with [[nil]]s. | | Changes the size of the given array. The command does not return new array, it resizes the source array to the desired number of elements. If the new size is bigger than the current size, the new places are filled with [[nil]]s. | ||
| array '''resize''' count | | array '''resize''' count | ||
|p1= array: [[Array]] | |p1= array: [[Array]] | ||
|p2= count: [[Number]] - the new number of elements. | |p2= count: [[Number]] - the new number of elements. | ||
| [[Nothing]] | | [[Nothing]] | ||
|x1= <code>_arrayNum = [0,1,2,3,4]; | |x1= <code>_arrayNum = [0,1,2,3,4]; | ||
_arrayNum [[resize]] 2; // _arrayNum is now [0,1] | _arrayNum [[resize]] 2; // _arrayNum is now [0,1] | ||
</code> | </code> | ||
| [[Array]], [[set]], [[reverse]], [[select]], [[in]], [[find]], [[findIf]], [[toArray]], [[toString]], [[forEach]], [[count]], [[pushBack]], [[pushBackUnique]], [[apply]], [[deleteAt]], [[deleteRange]], [[append]], [[sort]], [[param]], [[params]], [[arrayIntersect]], [[splitString]], [[joinString]] | | [[Array]], [[set]], [[reverse]], [[select]], [[in]], [[find]], [[findIf]], [[toArray]], [[toString]], [[forEach]], [[count]], [[pushBack]], [[pushBackUnique]], [[apply]], [[deleteAt]], [[deleteRange]], [[append]], [[sort]], [[param]], [[params]], [[arrayIntersect]], [[splitString]], [[joinString]] | ||
}} | }} |
Revision as of 01:19, 18 January 2021
Description
- Description:
- Changes the size of the given array. The command does not return new array, it resizes the source array to the desired number of elements. If the new size is bigger than the current size, the new places are filled with nils.
- Groups:
- Arrays
Syntax
- Syntax:
- array resize count
- Parameters:
- array: Array
- count: Number - the new number of elements.
- Return Value:
- Nothing
Examples
- Example 1:
_arrayNum = [0,1,2,3,4]; _arrayNum resize 2; // _arrayNum is now [0,1]
Additional Information
- See also:
- ArraysetreverseselectinfindfindIftoArraytoStringforEachcountpushBackpushBackUniqueapplydeleteAtdeleteRangeappendsortparamparamsarrayIntersectsplitStringjoinString
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
Bottom Section
- Posted on November 13, 2014 - 06:26 (UTC)
- DreadedEntity
-
Use this number to resize the array to the number of elements desired, not the desired index of the final element.
resize cannot be used to create a new array.
Categories:
- Scripting Commands
- Scripting Commands OFP 1.96
- ArmA: Armed Assault: Scripting Commands
- Introduced with Operation Flashpoint: Resistance version 1.75
- Operation Flashpoint: Resistance: New Scripting Commands
- Operation Flashpoint: Resistance: Scripting Commands
- Command Group: Arrays
- Scripting Commands OFP 1.99
- Arma 2: Scripting Commands
- Arma 3: Scripting Commands
- Take On Helicopters: Scripting Commands