---
name: "BIS_fnc_variableSpaceAdd"
type: function
status: ok
groups: ["Variables"]
arma3_since: "0.50"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/BIS_fnc_variableSpaceAdd
revid: 337310
updated: 2023-01-15T12:01:18Z
---

# BIS_fnc_variableSpaceAdd

*Function · Variables · Arma 3 v0.50 · introduced in Arma 2 v1.00*

## Description

Add element to variable from someone's variable space.

## Syntax

```sqf
[object, varName, element, global, inArray] call BIS_fnc_variableSpaceAdd
```

**Parameters:**

- `object`: [Object](../topics/Object.md) - owner of variable space
- `varName`: [String](../topics/String.md) - name of variable
- `element`: [Anything](../topics/Anything.md) - element which will be added (must be of same type as variable)
- `global`: [Boolean](../topics/Boolean.md) - (Optional, default [false](../commands/false.md)) [true](../commands/true.md) to save modified variable globally
- `inArray`: [Boolean](../topics/Boolean.md) - (Optional, default [false](../commands/false.md)) [true](../commands/true.md) to check if element is already in variable (only for [Array](../topics/Array.md)s)

**Returns:** [Anything](../topics/Anything.md) - updated variable

## Examples

### Example 1

```sqf
[player, "someVar", 1337, true, true] call BIS_fnc_variableSpaceAdd;
```

## See also

[BIS_fnc_variableSpaceRemove](../functions/BIS_fnc_variableSpaceRemove.md)

<sub>Source: [BI Community Wiki — BIS fnc variableSpaceAdd](https://community.bistudio.com/wiki/BIS_fnc_variableSpaceAdd) (revision 337310).</sub>
