a hash b: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
m (Fix duplicate argument call)
Line 1: Line 1:
{{Command|= Comments
{{Command|Comments=
____________________________________________________________________________________________
____________________________________________________________________________________________


| arma3 |= Game name
| arma3 |Game name=


|1.82|= Game version
|1.82|Game version=
____________________________________________________________________________________________
____________________________________________________________________________________________


| Selects an element from an array, same as [[select]] first syntax.
| Selects an element from an array, same as [[select]] first syntax.
{{Important|This syntax (array ''select'' index) is the only supported one!}} |= Description
{{Important|This syntax (array ''select'' index) is the only supported one!}} |Description=
____________________________________________________________________________________________
____________________________________________________________________________________________


| array  [[a_hash_b|#]] index |= Syntax
| array  [[a_hash_b|#]] index |Syntax=


| p1= array : [[Array]] |= Parameter 1
| p1= array: [[Array]] |Parameter 1=


| p2= index: [[Number]] |= Parameter 2
| p2= index: [[Number]] |Parameter 2=


| [[Anything]] |= Return value
| [[Anything]] |Return value=
____________________________________________________________________________________________
____________________________________________________________________________________________
   
   
   
   
|x1= <code>[1,2,3,4] [[a_hash_b|#]] 2; {{codecomment|// result is 3}}</code> |= Example 1
|x1= <code>[1,2,3,4] [[a_hash_b|#]] 2; {{codecomment|// result is 3}}</code> |Example 1=


|x2= <code>[[position]] [[player]] [[a_hash_b|#]] 2; {{codecomment|// result is Z coordinate of player's position}}</code> |= Example 2
|x2= <code>[[position]] [[player]] [[a_hash_b|#]] 2; {{codecomment|// result is Z coordinate of player's position}}</code> |Example 2=
____________________________________________________________________________________________
____________________________________________________________________________________________


| [[select]], [[selectRandom]], [[selectRandomWeighted]], [[set]], [[resize]], [[reverse]], [[in]], [[find]], [[toArray]], [[toString]], [[forEach]], [[count]], [[deleteAt]], [[deleteRange]], [[append]], [[sort]], [[param]], [[params]], [[splitString]], [[joinString]], [[pushBack]], [[pushBackUnique]], [[apply]] |= See also
| [[select]], [[selectRandom]], [[selectRandomWeighted]], [[set]], [[resize]], [[reverse]], [[in]], [[find]], [[toArray]], [[toString]], [[forEach]], [[count]], [[deleteAt]], [[deleteRange]], [[append]], [[sort]], [[param]], [[params]], [[splitString]], [[joinString]], [[pushBack]], [[pushBackUnique]], [[apply]] |See also=
}}
}}



Revision as of 00:44, 30 May 2018

Hover & click on the images for description

Description

Description:
Selects an element from an array, same as select first syntax.
This syntax (array select index) is the only supported one!
Groups:
Uncategorised

Syntax

Syntax:
array # index
Parameters:
array: Array
index: Number
Return Value:
Anything

Examples

Example 1:
[1,2,3,4] # 2; // result is 3
Example 2:
position player # 2; // result is Z coordinate of player's position

Additional Information

See also:
selectselectRandomselectRandomWeightedsetresizereverseinfindtoArraytoStringforEachcountdeleteAtdeleteRangeappendsortparamparamssplitStringjoinStringpushBackpushBackUniqueapply

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

Posted on April 25, 2018 - 00:51 (UTC)
KC Grimes
Although not alternative syntax, the below notations work as expected: ["A","B","C"] # 1; //B ["A","B","C"] #1; //B ["A","B","C"]#1; //B ["A","B",["C","D"]]#2#0; //C