---
name: "import"
type: command
status: ok
groups: ["Variables"]
arma3_since: "2.18"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/import
revid: 369760
updated: 2024-10-08T15:08:56Z
---

# import

*Command · Variables · Arma 3 v2.18*

## Description

Imports one or multiple local variables from the parent scope, and defines them as [private](../commands/private.md) variables in the current scope. It can bypass [privateAll](../commands/privateAll.md).

> [!NOTE]
> For the config keyword, see import (Config).

## Syntax

```sqf
import variableName
```

**Parameters:**

- `variableName`: [String](../topics/String.md) or [Array](../topics/Array.md) of [String](../topics/String.md)s - variable(s) to import

**Returns:** [Nothing](../topics/Nothing.md)

## Examples

### Example 1

```sqf
private _myVar = 1;
call
{
    import "_myVar"; // similar to: private _myVar = _myVar;
};
```

### Example 2

```sqf
private _a = 1;
private _b = 2;
call
{
    import ["_a", "_b"]; // similar to: [_a, _b] params ["_a", "_b"];
};
```

## See also

[privateAll](../commands/privateAll.md) · [private](../commands/private.md) · [params](../commands/params.md)

## Community notes

**Hypoxic125** — 2024-03-03

When making local functions, the imported variable does not have to exist until the function is called.

```sqf
// Local function
private _stringifyNum = {
    import "_num";
    str _num;
};

private _num = 5;
call _stringifyNum;
// Returns "5"
```

<sub>Source: [BI Community Wiki — import](https://community.bistudio.com/wiki/import) (revision 369760).</sub>
