{"name":"BIS_fnc_setToPairs","operator":null,"title":"BIS fnc setToPairs","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_setToPairs","revid":349084,"updated":"2023-11-08T14:47:24Z","groups":["Arrays"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.00"}],"since":{"game":"arma3","name":"Arma 3","version":"1.00"},"arma3_since":"1.00","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Works similar to the BIS_fnc_addToPairs but it doesn't try to add values. It just overwrites the volue if the key already exists.","syntaxes":[{"syntax":"[array, key, newValue] call BIS_fnc_setToPairs","since":null,"effect":null,"exec":null,"params":[{"name":"array","type":"Array","optional":false,"default":null,"description":"array to search through","types":["Array"],"since":null,"text":"array: Array - array to search through"},{"name":"key","type":"String","optional":false,"default":null,"description":"key to search for","types":["String"],"since":null,"text":"key: String - key to search for"},{"name":"newValue","type":"Anything","optional":true,"default":"1","description":"new value set if match was found","types":["Anything"],"since":null,"text":"newValue: Anything - (Optional, default 1) new value set if match was found"}],"returns":{"type":"Array","types":["Array"],"description":"resulting modified array","text":"Array - resulting modified array"}}],"examples":[{"text":"```sqf\n[[[\"apple\",3],[\"pear\",2]],\"pear\",10] call BIS_fnc_setToPairs; // Returns [[\"apple\",3],[\"pear\",10]]\n```","code":["[[[\"apple\",3],[\"pear\",2]],\"pear\",10] call BIS_fnc_setToPairs; // Returns [[\"apple\",3],[\"pear\",10]]"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["find","findIf","BIS_fnc_findInPairs","BIS_fnc_getFromPairs","BIS_fnc_addToPairs","BIS_fnc_removeFromPairs"],"notes":[],"categories":["Arma 3: Functions","Arma 3: New Functions","Function Group: Arrays","Functions","Introduced with Arma 3 version 1.00"],"docblock":null,"filled_from_docblock":[]}