{"name":"BIS_fnc_conditionalSelect","operator":null,"title":"BIS fnc conditionalSelect","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_conditionalSelect","revid":327949,"updated":"2022-07-13T12:57:27Z","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":"This returns a sub-array of elements that satisfy a specific condition **in the order they have been passed**.\n\n> [!NOTE]\n> **Arma 3:** Since Arma 3 v1.55, use `array select condition` instead.\n\nIn the condition, the currently tested element is assigned to the variable \"_x\".\nThe original array is **not** modified.","syntaxes":[{"syntax":"[items, condition] call BIS_fnc_conditionalSelect","since":null,"effect":null,"exec":null,"params":[{"name":"items","type":"Array","optional":false,"default":null,"description":"array to check","types":["Array"],"since":null,"text":"items: Array - array to check"},{"name":"condition","type":"Code","optional":false,"default":null,"description":"selection code","types":["Code"],"since":null,"text":"condition: Code - selection code"}],"returns":{"type":"Array","types":["Array"],"description":null,"text":"Array"}}],"examples":[{"text":"```sqf\n[[10, 0, 8, 2, 6, 4], { _x > 5 }] call BIS_fnc_conditionalSelect; // will return [10,8,6]\n```","code":["[[10, 0, 8, 2, 6, 4], { _x > 5 }] call BIS_fnc_conditionalSelect; // will return [10,8,6]"]},{"text":"```sqf\n[[10, true, 8, player], { typeName _x == \"STRING\" }] call BIS_fnc_conditionalSelect; // will return []\n```","code":["[[10, true, 8, player], { typeName _x == \"STRING\" }] call BIS_fnc_conditionalSelect; // will return []"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["select","count"],"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":[]}