BIS fnc configPath: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " *\|= * " to " ") |
Lou Montana (talk | contribs) m (Text replacement - " *\| *([Cc]omments|COMMENTS|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments \("local" or "global"\)|Multiplayer Effects \("local" or "global"\)|Multiplayer Execution \("server" o...) |
||
Line 1: | Line 1: | ||
{{Function | {{Function | ||
| arma3 | | arma3 | ||
|1.00 | |1.00 | ||
|gr1= Configs | |gr1= Configs | ||
|Returns config path to given entry in given format | |Returns config path to given entry in given format | ||
| [config, format, strict] call [[BIS_fnc_configPath]]; | | [config, format, strict] call [[BIS_fnc_configPath]]; | ||
|p1= config: [[Array]], [[String]] or [[Config]] - input config | |p1= config: [[Array]], [[String]] or [[Config]] - input config | ||
|p2= format (Optional): [[Array]], [[String]] or [[Config]] - desired format of output. Default: [[Array]], unless [[Array]] is input, then [[Config]] is returned (see Example 1) | |p2= format (Optional): [[Array]], [[String]] or [[Config]] - desired format of output. Default: [[Array]], unless [[Array]] is input, then [[Config]] is returned (see Example 1) | ||
|p3= strict (Optional): [[Boolean]] - by default the function will not attempt to construct a valid config before certain format conversions (see Example 2). Set this param to [[true]] to invoke the strict mode | |p3= strict (Optional): [[Boolean]] - by default the function will not attempt to construct a valid config before certain format conversions (see Example 2). Set this param to [[true]] to invoke the strict mode | ||
|[[Array]], [[String]] or [[Config]] | |[[Array]], [[String]] or [[Config]] | ||
|x1= <code>["configFile >> ""CfgVehicles"" >> ""Car"""] [[call]] [[BIS_fnc_configPath]]; // ["configFile","CfgVehicles","Car"] | |x1= <code>["configFile >> ""CfgVehicles"" >> ""Car"""] [[call]] [[BIS_fnc_configPath]]; // ["configFile","CfgVehicles","Car"] | ||
<nowiki>[</nowiki>["configFile","CfgVehicles","Car"]] [[call]] [[BIS_fnc_configPath]]; // bin\config.cpp/CfgVehicles/Car | <nowiki>[</nowiki>["configFile","CfgVehicles","Car"]] [[call]] [[BIS_fnc_configPath]]; // bin\config.cpp/CfgVehicles/Car | ||
["bin\config.cpp/CfgVehicles/Car"] [[call]] [[BIS_fnc_configPath]]; // ["configFile","CfgVehicles","Car"] | ["bin\config.cpp/CfgVehicles/Car"] [[call]] [[BIS_fnc_configPath]]; // ["configFile","CfgVehicles","Car"] | ||
[configFile >> "CfgVehicles" >> "Car", ""] [[call]] [[BIS_fnc_configPath]]; // "configFile >> ""CfgVehicles"" >> ""Car"""</code> | [configFile >> "CfgVehicles" >> "Car", ""] [[call]] [[BIS_fnc_configPath]]; // "configFile >> ""CfgVehicles"" >> ""Car"""</code> | ||
|x2= <code><nowiki>[</nowiki>["mary", "had", "a", "little", "lamb"], ""] [[call]] [[BIS_fnc_configPath]]; // "mary >> ""had"" >> ""a"" >> ""little"" >> ""lamb""" | |x2= <code><nowiki>[</nowiki>["mary", "had", "a", "little", "lamb"], ""] [[call]] [[BIS_fnc_configPath]]; // "mary >> ""had"" >> ""a"" >> ""little"" >> ""lamb""" | ||
Line 27: | Line 27: | ||
["bin\config.cpp/CfgVehicles/Car", "", [[true]]] [[call]] [[BIS_fnc_configPath]]; // "configFile >> ""CfgVehicles"" >> ""Car"""</code> | ["bin\config.cpp/CfgVehicles/Car", "", [[true]]] [[call]] [[BIS_fnc_configPath]]; // "configFile >> ""CfgVehicles"" >> ""Car"""</code> | ||
|[[configHierarchy]] | |[[configHierarchy]] | ||
}} | }} |
Revision as of 22:40, 17 January 2021
Description
Syntax
- Syntax:
- [config, format, strict] call BIS_fnc_configPath;
- Parameters:
- config: Array, String or Config - input config
- format (Optional): Array, String or Config - desired format of output. Default: Array, unless Array is input, then Config is returned (see Example 1)
- strict (Optional): Boolean - by default the function will not attempt to construct a valid config before certain format conversions (see Example 2). Set this param to true to invoke the strict mode
- Return Value:
- Array, String or Config
Examples
- Example 1:
["configFile >> ""CfgVehicles"" >> ""Car"""] call BIS_fnc_configPath; // ["configFile","CfgVehicles","Car"] [["configFile","CfgVehicles","Car"]] call BIS_fnc_configPath; // bin\config.cpp/CfgVehicles/Car ["bin\config.cpp/CfgVehicles/Car"] call BIS_fnc_configPath; // ["configFile","CfgVehicles","Car"] [configFile >> "CfgVehicles" >> "Car", ""] call BIS_fnc_configPath; // "configFile >> ""CfgVehicles"" >> ""Car"""
- Example 2:
[["mary", "had", "a", "little", "lamb"], ""] call BIS_fnc_configPath; // "mary >> ""had"" >> ""a"" >> ""little"" >> ""lamb""" [["mary", "had", "a", "little", "lamb"], "", true] call BIS_fnc_configPath; // "" invalid config ["bin\config.cpp/CfgVehicles/Car", ""] call BIS_fnc_configPath; // "bin\config.cpp/CfgVehicles/Car" ["bin\config.cpp/CfgVehicles/Car", "", true] call BIS_fnc_configPath; // "configFile >> ""CfgVehicles"" >> ""Car"""
Additional Information
- See also:
- configHierarchy
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