Arma 3 Scripting

Function in Bitwise

BIS_fnc_encodeFlags2

Also available as Markdown and JSON, or read the original wiki page.

Description

Encodes array of unique binary flags (zeroes or ones) into a single scalar.

Important

Note that the input array is in Big Endian, meaning that the smallest value is to the left.

Syntax

arrayOfNumbers call BIS_fnc_encodeFlags2

Parameters:

Returns: Number - the calculated number

Examples

Example 1

private _result = [1,0,1,1] call BIS_fnc_encodeFlags2;
hint str _result; // Displays 13

See also

BIS_fnc_encodeFlags · BIS_fnc_encodeFlags4 · BIS_fnc_encodeFlags8 · BIS_fnc_decodeFlags · BIS_fnc_decodeFlags2 · BIS_fnc_decodeFlags4 · BIS_fnc_decodeFlags8