---
name: "compile"
type: command
status: ok
groups: ["Strings"]
arma3_since: "0.50"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/compile
revid: 321043
updated: 2022-05-13T12:05:32Z
---

# compile

*Command · Strings · Arma 3 v0.50 · introduced in Armed Assault v1.00*

## Description

Compiles [String](../topics/String.md) expression into [Code](../topics/Code.md).

## Syntax

```sqf
compile expression
```

**Parameters:**

- `expression`: [String](../topics/String.md) - expression to be compiled

**Returns:** [Code](../topics/Code.md) - compiled expression

## Examples

### Example 1

```sqf
_string = "a = a + 1";
_code = compile _string;
call _code;
```

### Example 2

```sqf
hint str compile "a = b";
// result: { a = b }
```

## See also

[call](../commands/call.md) · [spawn](../commands/spawn.md) · [compileFinal](../commands/compileFinal.md) · [compileScript](../commands/compileScript.md) · [parseSimpleArray](../commands/parseSimpleArray.md) · [isFinal](../commands/isFinal.md)

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