---
name: "BIS_fnc_bitflagsSet"
type: function
status: ok
groups: ["Bitwise"]
arma3_since: "1.66"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/BIS_fnc_bitflagsSet
revid: 328600
updated: 2022-07-13T17:02:31Z
---

# BIS_fnc_bitflagsSet

*Function · Bitwise · Arma 3 v1.66*

## Description

Sets one or more flags in the given flagset, represented with decimal or hexadecimal number

(Hexadecimal number representation is simply auto-converted into decimal by the engine)

To check which flags are present in given flagset use [BIS_fnc_bitflagsToArray](../functions/BIS_fnc_bitflagsToArray.md)

**Limitations**:

Due to various limitations of the Real Virtuality engine this function is
intended to work with unsigned 24 bit integers only. This means that the
supported range is 2^0...2^24 (1...16777216)

## Syntax

```sqf
[flagset, flag] call BIS_fnc_bitflagsSet
```

**Parameters:**

- `flagset`: [Number](../topics/Number.md) - flagset
- `flag`: [Number](../topics/Number.md) - one or more flags to set

**Returns:** [Number](../topics/Number.md)  - new flagset with given flag or flags set

## Examples

### Example 1

```sqf
[0, 16] call BIS_fnc_bitflagsSet; // 16
[16, 2] call BIS_fnc_bitflagsSet; // 18 (which is 2 + 16)
[18, 2 + 8 + 16] call BIS_fnc_bitflagsSet; // 26 (which is 2 + 8 + 16)
```

## See also

[BIS_fnc_bitflagsFlip](../functions/BIS_fnc_bitflagsFlip.md) · [BIS_fnc_bitflagsCheck](../functions/BIS_fnc_bitflagsCheck.md) · [BIS_fnc_bitflagsToArray](../functions/BIS_fnc_bitflagsToArray.md) · [BIS_fnc_bitflagsUnset](../functions/BIS_fnc_bitflagsUnset.md)

<sub>Source: [BI Community Wiki — BIS fnc bitflagsSet](https://community.bistudio.com/wiki/BIS_fnc_bitflagsSet) (revision 328600).</sub>
