a hash b: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (aaaaaaa)
No edit summary
Line 45: Line 45:
["A","B","C"]#1; //B
["A","B","C"]#1; //B
["A","B",["C","D"]]#2#0; //C</code>
["A","B",["C","D"]]#2#0; //C</code>
</dd>
</dl>
<!-- DISCONTINUE Notes -->
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on May 3, 2019 - 15:41 (UTC)</dd>
<dt class="note">[[User:7erra|7erra]]</dt>
<dd class="note">
This operator can not be used in conjunction with the #define preprocessor.<br>
<code><nowiki>#define SEL_ERR [0,1,2]#0 //error
#define SEL_NOERR [0,1,2] select 0 //works</nowiki></code>
</dd>
</dd>
</dl>
</dl>
<!-- DISCONTINUE Notes -->
<!-- DISCONTINUE Notes -->

Revision as of 16:41, 3 May 2019

Hover & click on the images for description

Description

Description:
Selects an element from an array, same as select command for arrays, but has higher precedence
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
Posted on May 3, 2019 - 15:41 (UTC)
7erra
This operator can not be used in conjunction with the #define preprocessor.
#define SEL_ERR [0,1,2]#0 //error #define SEL_NOERR [0,1,2] select 0 //works