BIS fnc loadFunctions: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (1 revision)
(Page filling)
Line 1: Line 1:
 
{{Function|Comments=
{{Function|= Comments
____________________________________________________________________________________________
____________________________________________________________________________________________


| arma3 |= Game name
| arma3 |Game name=


|1.00|= Game version
|1.00|Game version=
____________________________________________________________________________________________
____________________________________________________________________________________________


| <pre>/*
| Compile scripts and save them into globally available functions. Defines [[_fnc_scriptName]] variable. |Description=
____________________________________________________________________________________________


Description:
| [fileDirectory, prefix, nameVars, global] call [[BIS_fnc_loadFunctions]] |Syntax=
Compile scripts and save them into globally available functions.


Parameter(s):
|p1= fileDirectory: [[String]] - script path |Parameter 1=
0: STRING - script path
1: STRING - variable prefix
2: ARRAY - list of variables to be declared. Elements can be of following types:
variable: STRING - variable is (prefix + variable), loaded from (path + variable + ".sqf")
[variable:STRING,fileName:STRING] - variable is (prefix  variable), loaded from (path + fileName + ".sqf")
3: BOOL - true for global persistent execution on all clients


Returns:
|p2= prefix: [[String]] - variable prefix {{Informative|<tt>"BIS_fnc_"</tt> prefix is reserved and cannot be used.}} |Parameter 2=
BOOL
*/


</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
|p3= nameVars: [[Array]] of [[String|Strings]] '''or''' [[Array]] of [[Array]] - list of variables to be declared.
____________________________________________________________________________________________
* [[Array]] of [[String|Strings]] to format [variable, variable, …] - final variable is <tt>prefix + variable</tt>, loaded from <tt>path + variable + ".sqf"</tt>
* [[Array]] of [[Array]] to format <nowiki>[</nowiki>[variable, fileName], [variable, fileName], …] - final variable is <tt>prefix + variable</tt>, loaded from <tt>path + fileName + ".sqf"</tt> |Parameter 3=


| <!-- [] call [[BIS_fnc_loadFunctions]]; --> |= Syntax
|p4= global: [[Boolean]] - [[true]] for global persistent execution on all clients |Parameter 4=


|p1= |= Parameter 1
| [[Boolean]] - [[true]] when done |Return value=
____________________________________________________________________________________________


| |= Return value
|x1= <code>["scripts\myDir\", "MY_fnc_", ["script1", "script2"], [[true]]] [[call]] [[BIS_fnc_loadFunctions]];</code> |Example 1=
____________________________________________________________________________________________


|x1= <code></code> |=  
|x2= <code>["scripts\myDir\", "MY_fnc_", [["script1", "script1file"], ["script2", "script2file"]], [[false]]] [[call]] [[BIS_fnc_loadFunctions]];</code> |Example 2=
____________________________________________________________________________________________
____________________________________________________________________________________________


| |= See also
| [[compile]], [[compileFinal]], [[preprocessFileLineNumbers]] |See also=
 
}}
}}


Line 50: Line 41:


<h3 style="display:none">Bottom Section</h3>
<h3 style="display:none">Bottom Section</h3>
[[Category:Functions|{{uc:loadFunctions}}]]
[[Category:Function Group: Variables|{{uc:loadFunctions}}]]
[[Category:Function Group: Variables|{{uc:loadFunctions}}]]
[[Category:Functions|{{uc:loadFunctions}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:loadFunctions}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:loadFunctions}}]]

Revision as of 11:06, 2 July 2018

Hover & click on the images for description

Description

Description:
Compile scripts and save them into globally available functions. Defines _fnc_scriptName variable.
Execution:
call
Groups:
Uncategorised

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

Notes

Bottom Section