BIS fnc loadFunctions: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " \| *(\[\[[a-zA-Z ]+\]\].+) \|x1=" to " |r1=$1 |x1=")
m (Text replacement - " \| *(\[[a-zA-Z,. ]*\] call ('''|\[\[)?BI(N|S)_fnc_[a-zA-Z]+('''|\]\])?) * \|p1=" to " |s1=$1 |p1=")
Line 9: Line 9:
| Compile scripts and save them into globally available functions. Defines [[_fnc_scriptName]] variable.
| Compile scripts and save them into globally available functions. Defines [[_fnc_scriptName]] variable.


| [fileDirectory, prefix, nameVars, global] call [[BIS_fnc_loadFunctions]]
|s1=[fileDirectory, prefix, nameVars, global] call [[BIS_fnc_loadFunctions]]


|p1= fileDirectory: [[String]] - script path
|p1= fileDirectory: [[String]] - script path

Revision as of 16:57, 12 June 2021

Hover & click on the images for description

Description

Description:
Description needed
Execution:
call
Groups:
Diagnostic

Syntax

Syntax:
[fileDirectory, prefix, nameVars, global] call BIS_fnc_loadFunctions
Parameters:
fileDirectory: String - script path
prefix: String - variable prefix
"BIS_fnc_" prefix is reserved and cannot be used.
nameVars: Array of Strings or Array of Array - list of variables to be declared.
  • Array of Strings to format [variable, variable, …] - final variable is prefix + variable, loaded from path + variable + ".sqf"
  • Array of Array to format [[variable, fileName], [variable, fileName], …] - final variable is prefix + variable, loaded from path + fileName + ".sqf"
global: Boolean - true for global persistent execution on all clients
Return Value:
Boolean - true when done

Examples

Example 1:
["scripts\myDir\", "MY_fnc_", ["script1", "script2"], true] call BIS_fnc_loadFunctions;
Example 2:
["scripts\myDir\", "MY_fnc_", [["script1", "script1file"], ["script2", "script2file"]], false] call BIS_fnc_loadFunctions;

Additional Information

See also:
compilecompileFinalpreprocessFileLineNumbers

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note