{"name":"BIS_fnc_loadFunctions","title":"BIS fnc loadFunctions","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_loadFunctions","revid":352078,"updated":"2024-02-01T23:24:43Z","groups":["Diagnostic"],"status":"ok","games":{"arma3":"1.00"},"since":"arma3 1.00","arma3_since":"1.00","description":"Compile scripts and save them into globally available functions. Defines _fnc_scriptName variable.","syntaxes":[{"syntax":"[fileDirectory, prefix, nameVars, global] call BIS_fnc_loadFunctions","params":[{"name":"fileDirectory","type":"String","description":"script path","type_expr":"String"},{"name":"prefix","type":"String","description":"variable prefix\n\n> [!NOTE]\n> `\"BIS_fnc_\"` prefix is reserved and cannot be used.","type_expr":"String"},{"name":"nameVars","type":"Array of Strings or Array of Array","description":"list of variables to be declared.\n\n- Array of Strings to format [variable, variable, …] - final variable is `prefix + variable`, loaded from `path + variable + \".sqf\"`\n- Array of Array to format [[variable, fileName], [variable, fileName], …] - final variable is `prefix + variable`, loaded from `path + fileName + \".sqf\"`","type_expr":"Array<String> | Array<Array>","text":"nameVars: Array of Strings **or** Array of Array - list of variables to be declared.\n\n- Array of Strings to format [variable, variable, …] - final variable is `prefix + variable`, loaded from `path + variable + \".sqf\"`\n- Array of Array to format [[variable, fileName], [variable, fileName], …] - final variable is `prefix + variable`, loaded from `path + fileName + \".sqf\"`"},{"name":"global","type":"Boolean","description":"true for global persistent execution on all clients","type_expr":"Boolean"}],"returns":{"type":"Boolean","type_expr":"Boolean","description":"true when done"}}],"examples":[{"code":["[\"scripts\\myDir\\\", \"MY_fnc_\", [\"script1\", \"script2\"], true] call BIS_fnc_loadFunctions;"]},{"code":["[\"scripts\\myDir\\\", \"MY_fnc_\", [[\"script1\", \"script1file\"], [\"script2\", \"script2file\"]], false] call BIS_fnc_loadFunctions;"]}],"see_also":["compile","compileFinal","preprocessFileLineNumbers"]}