{"name":"BIS_fnc_subSelect","operator":null,"title":"BIS fnc subSelect","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_subSelect","revid":327163,"updated":"2022-07-12T22:02:05Z","groups":["Arrays"],"status":"ok","replaced_by":[],"games":[{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"arma2","name":"Arma 2","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Returns a sub-selection of the passed array.","syntaxes":[{"syntax":"[array, start, endOrLength] call BIS_fnc_subSelect","since":null,"effect":null,"exec":null,"params":[{"name":"array","type":"Array array to select sub array from","optional":false,"default":null,"description":null,"types":["Array"],"since":null,"text":"array: Array array to select sub array from"},{"name":"start","type":null,"optional":false,"default":null,"description":"Number index of array to begin sub-array. **If negative**, index is counted from the end of array","types":["Number"],"since":null,"text":"start: Number index of array to begin sub-array. **If negative**, index is counted from the end of array"},{"name":"endOrLength","type":"Number","optional":false,"default":null,"description":"index of array to end the sub-array. If ommitted, remainder of the array will be selected. **If negative**, it specifies the length of the sub-array (in absolute form)","types":["Number"],"since":null,"text":"endOrLength: Number - index of array to end the sub-array. If ommitted, remainder of the array will be selected. **If negative**, it specifies the length of the sub-array (in absolute form)"}],"returns":{"type":"Array","types":["Array"],"description":null,"text":"Array"}}],"examples":[{"text":"```sqf\nprivate _array = [\"a\", \"b\", true, 3, 8];\n[_array, 2] call BIS_fnc_subSelect;            // returns [true,3,8]\n```","code":["private _array = [\"a\", \"b\", true, 3, 8];\n[_array, 2] call BIS_fnc_subSelect;\t\t\t// returns [true,3,8]"]},{"text":"```sqf\n[_array, -2] call BIS_fnc_subSelect;            // returns [3,8]\n```","code":["[_array, -2] call BIS_fnc_subSelect;\t\t\t// returns [3,8]"]},{"text":"```sqf\n[_array, 1, 3] call BIS_fnc_subSelect;            // returns [\"b\",true,3]\n```","code":["[_array, 1, 3] call BIS_fnc_subSelect;\t\t\t// returns [\"b\",true,3]"]},{"text":"```sqf\n[_array, 1, -2] call BIS_fnc_subSelect;        // returns [\"b\",true]\n```","code":["[_array, 1, -2] call BIS_fnc_subSelect;\t\t// returns [\"b\",true]"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["select","count","selectRandom","BIS_fnc_arrayShuffle","BIS_fnc_randomIndex"],"notes":[],"categories":["Arma 2: Functions","Arma 2: New Functions","Arma 2: Operation Arrowhead: Functions","Arma 3: Functions","Function Group: Arrays","Functions","Introduced with Arma 2 version 1.00","Take On Helicopters: Functions"],"docblock":null,"filled_from_docblock":[]}