{"name":"BIS_fnc_encodeFlags2","operator":null,"title":"BIS fnc encodeFlags2","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_encodeFlags2","revid":337995,"updated":"2023-02-23T21:11:09Z","groups":["Bitwise"],"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":"Encodes array of unique binary flags (zeroes or ones) into a single scalar.\n\n> [!IMPORTANT]\n> Note that the input array is in [Big Endian](https://en.wikipedia.org/wiki/Endianness#Definition), meaning that the smallest value is **to the left**.","syntaxes":[{"syntax":"arrayOfNumbers call BIS_fnc_encodeFlags2","since":null,"effect":null,"exec":null,"params":[{"name":"arrayOfNumbers","type":"Array of Numbers","optional":false,"default":null,"description":"\"boolean\" flags where 0 = false and 1 = true","types":["Array","Number"],"since":null,"text":"arrayOfNumbers: Array of Numbers - \"boolean\" flags where 0 = false and 1 = true"}],"returns":{"type":"Number","types":["Number"],"description":"the calculated number","text":"Number - the calculated number"}}],"examples":[{"text":"```sqf\nprivate _result = [1,0,1,1] call BIS_fnc_encodeFlags2;\nhint str _result; // Displays 13\n```","code":["private _result = [1,0,1,1] call BIS_fnc_encodeFlags2;\nhint str _result; // Displays 13"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["BIS_fnc_encodeFlags","BIS_fnc_encodeFlags4","BIS_fnc_encodeFlags8","BIS_fnc_decodeFlags","BIS_fnc_decodeFlags2","BIS_fnc_decodeFlags4","BIS_fnc_decodeFlags8"],"notes":[],"categories":["Arma 3: Functions","Arma 3: New Functions","Function Group: Bitwise","Functions","Introduced with Arma 3 version 1.00"],"docblock":null,"filled_from_docblock":[]}