select: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m (Reverted edits by Heecf..... (talk) to last revision by Str) |
||
Line 1: | Line 1: | ||
{{Command|= Comments | |||
____________________________________________________________________________________________ | |||
| ofp |= Game name | |||
|1.00|= Game version | |||
____________________________________________________________________________________________ | |||
| Selects an index element of an array or config object. | |||
Index 0 denotes the first element, 1 the second, etc.<br> | |||
If index has decimal places it gets rounded down for fractions less than .5, otherwise it gets rounded up. |= Description | |||
____________________________________________________________________________________________ | |||
| array '''select''' index |= Syntax | |||
|p1= array : [[Array]] |= Parameter 1 | |||
|p2= index: [[Number]] |= Parameter 2 | |||
| [[Any Value]] |= Return value | |||
____________________________________________________________________________________________ | |||
|s2= config '''select''' index |= Syntax | |||
|p21= config: [[Config]] |= Parameter 1 | |||
|p22= index: [[Number]] |= Parameter 2 | |||
|r2= [[Config]] |= Return value | |||
____________________________________________________________________________________________ | |||
|x1= <code>[1,2,3,4] select 2</code> - result is 3 |= Example 1 | |||
|x2= <code>[[position]] [[player]] select 2</code> - result is Z coordinate of player position (see [[Position]] for more details) |= Example 3 | |||
|x3= <code>(configFile >> "CfgVehicles") select 0 </code>|= Example 4 | |||
____________________________________________________________________________________________ | |||
| [[count]] |= SEEALSO | |||
}} | |||
<h3 style="display:none">Notes</h3> | |||
<dl class="command_description"> | |||
<!-- Note Section BEGIN --> | |||
When combined with the [[count]] command, this can be used to read all entries out of a config; even when you don't know exactly how many entries there will be. See the notes under [[count]] for more info. | |||
--[[User:General Barron|General Barron]] 02:02, 3 March 2009 (CET) | |||
<!-- Note Section END --> | |||
</dl> | |||
<h3 style="display:none">Bottom Section</h3> | |||
[[Category:Scripting Commands|SELECT]] | |||
[[Category:Scripting Commands OFP 1.96|SELECT]] | |||
[[Category:Scripting Commands OFP 1.46|SELECT]] | |||
[[Category:Scripting Commands ArmA|SELECT]] | |||
[[Category:Command_Group:_Variables|{{uc:{{PAGENAME}}}}]] | |||
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]] | |||
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]] | |||
Revision as of 00:19, 21 August 2012
Description
- Description:
- Selects an index element of an array or config object.
Index 0 denotes the first element, 1 the second, etc.
If index has decimal places it gets rounded down for fractions less than .5, otherwise it gets rounded up. - Groups:
- Uncategorised
Syntax
Alternative Syntax
Examples
- Example 1:
[1,2,3,4] select 2
- result is 3- Example 2:
position player select 2
- result is Z coordinate of player position (see Position for more details)- Example 3:
(configFile >> "CfgVehicles") select 0
Additional Information
- See also:
- count
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
-
When combined with the count command, this can be used to read all entries out of a config; even when you don't know exactly how many entries there will be. See the notes under count for more info.
--General Barron 02:02, 3 March 2009 (CET)
Bottom Section
Categories:
- Scripting Commands
- Introduced with Operation Flashpoint version 1.00
- Operation Flashpoint: New Scripting Commands
- Operation Flashpoint: Scripting Commands
- Command Group: Uncategorised
- Scripting Commands OFP 1.96
- Scripting Commands OFP 1.46
- Scripting Commands ArmA
- Command Group: Variables
- Scripting Commands ArmA2
- Scripting Commands Take On Helicopters