---
name: "compileScript"
type: command
status: ok
groups: ["System"]
arma3_since: "2.02"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/compileScript
revid: 365141
updated: 2024-07-26T16:44:13Z
---

# compileScript

*Command · System · Arma 3 v2.02*

## Description

This command is an alias for `compile(Final) (prefixHeader + preprocessFileLineNumbers path)`. See description of [preprocessFileLineNumbers](../commands/preprocessFileLineNumbers.md) for more details.

In addition, this command can also compile SQF Bytecode files, which can reduce compilation time. If both a .sqf file and .sqfc file are pressing in the the path, this command will automatically compile the .sqfc file.

## Syntax

```sqf
compileScript [path, final, prefixHeader]
```

**Parameters:**

- `path`: [String](../topics/String.md) - path to script file
- `final`: [Boolean](../topics/Boolean.md) - (Optional, default [false](../commands/false.md)) compile final, see [compileFinal](../commands/compileFinal.md)
- `prefixHeader`: [String](../topics/String.md) - (Optional, default "") value added at the beginning of the file

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

## Examples

### Example 1

```sqf
compileScript ["a3\props_f_enoch\military\equipment\scripts\meteo.sqf"];
// has the same functionality as 
compile preprocessFileLineNumbers "a3\props_f_enoch\military\equipment\scripts\meteo.sqf";
```

## See also

[compile](../commands/compile.md) · [compileFinal](../commands/compileFinal.md) · [preprocessFileLineNumbers](../commands/preprocessFileLineNumbers.md) · [preprocessFile](../commands/preprocessFile.md) · [call](../commands/call.md) · [spawn](../commands/spawn.md)

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