a hash b: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Some wiki formatting) |
Lou Montana (talk | contribs) m (Text replacement - "\{\{Feature *\| *Informative *\| *([^↵]+) *\}\}" to "{{Feature|informative|$1}}") |
||
Line 9: | Line 9: | ||
|descr= Selects an element from an [[Array | array]], same as [[select]] command for arrays, but has [[Order_of_Precedence | higher precedence]] | |descr= Selects an element from an [[Array | array]], same as [[select]] command for arrays, but has [[Order_of_Precedence | higher precedence]] | ||
{{Feature | | {{Feature|informative| '''#''' has higher precedence than all binary operators, but it has lower precedence than unary operators (see Example 3)}} | ||
|s1= array [[a_hash_b|#]] index | |s1= array [[a_hash_b|#]] index | ||
Revision as of 18:05, 15 March 2024
Description
- Description:
- Selects an element from an array, same as select command for arrays, but has higher precedence
- Groups:
- Variables
Syntax
Examples
- Example 1:
- [1,2,3,4] # 2; // result is 3
- Example 2:
- Example 3:
Additional Information
- 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
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
- Posted on Apr 25, 2018 - 00:51 (UTC)
-
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
- Posted on May 03, 2019 - 15:41 (UTC)
-
Here is an example of what higher precedence means:
This operator can not be used in conjunction with the #define preprocessor.
- Posted on Apr 02, 2021 - 16:18 (UTC)
-
Beware new-lines when using this operator. I suspect the preprocessor to fail. The following code will not compile without throwing an error:
[0] # 0;