---
name: "BIS_fnc_loadFunctions"
type: function
status: ok
groups: ["Diagnostic"]
arma3_since: "1.00"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/BIS_fnc_loadFunctions
revid: 352078
updated: 2024-02-01T23:24:43Z
---

# BIS_fnc_loadFunctions

*Function · Diagnostic · Arma 3 v1.00*

## Description

Compile scripts and save them into globally available functions. Defines [_fnc_scriptName](../topics/Magic_Variables.md) variable.

## Syntax

```sqf
[fileDirectory, prefix, nameVars, global] call BIS_fnc_loadFunctions
```

**Parameters:**

- `fileDirectory`: [String](../topics/String.md) - script path
- `prefix`: [String](../topics/String.md) - variable prefix 

  > [!NOTE]
  > `"BIS_fnc_"` prefix is reserved and cannot be used.
- `nameVars`: [Array](../topics/Array.md) of [String](../topics/String.md)s **or** [Array](../topics/Array.md) of [Array](../topics/Array.md) - list of variables to be declared.
  - [Array](../topics/Array.md) of [String](../topics/String.md)s to format [variable, variable, …] - final variable is `prefix + variable`, loaded from `path + variable + ".sqf"`
  - [Array](../topics/Array.md) of [Array](../topics/Array.md) to format [[variable, fileName], [variable, fileName], …] - final variable is `prefix + variable`, loaded from `path + fileName + ".sqf"`
- `global`: [Boolean](../topics/Boolean.md) - [true](../commands/true.md) for global persistent execution on all clients

**Returns:** [Boolean](../topics/Boolean.md) - [true](../commands/true.md) when done

## Examples

### Example 1

```sqf
["scripts\myDir\", "MY_fnc_", ["script1", "script2"], true] call BIS_fnc_loadFunctions;
```

### Example 2

```sqf
["scripts\myDir\", "MY_fnc_", [["script1", "script1file"], ["script2", "script2file"]], false] call BIS_fnc_loadFunctions;
```

## See also

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

<sub>Source: [BI Community Wiki — BIS fnc loadFunctions](https://community.bistudio.com/wiki/BIS_fnc_loadFunctions) (revision 352078).</sub>
