BIS fnc configPath: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "<code>([^<]*)\{\{cc\|([^{}]+)\}\} *<\/code>" to "<code>$1// $2</code>") |
Lou Montana (talk | contribs) m (Text replacement - "<code> *([^<|{]*) *<\/code>" to "<sqf>$1</sqf>") |
||
Line 16: | Line 16: | ||
|r1= [[Array]], [[String]] or [[Config]] | |r1= [[Array]], [[String]] or [[Config]] | ||
|x1= < | |x1= <sqf>["configFile >> ""CfgVehicles"" >> ""Car"""] call BIS_fnc_configPath; // ["configFile","CfgVehicles","Car"]</sqf> | ||
|x2= <code><nowiki>[</nowiki>["mary", "had", "a", "little", "lamb"], ""] [[call]] [[BIS_fnc_configPath]]; {{cc|"mary >> ""had"" >> ""a"" >> ""little"" >> ""lamb"""}}</code> | |x2= <code><nowiki>[</nowiki>["mary", "had", "a", "little", "lamb"], ""] [[call]] [[BIS_fnc_configPath]]; {{cc|"mary >> ""had"" >> ""a"" >> ""little"" >> ""lamb"""}}</code> | ||
Line 22: | Line 22: | ||
|x3= <code><nowiki>[</nowiki>["configFile","CfgVehicles","Car"]] [[call]] [[BIS_fnc_configPath]]; {{cc|bin\config.cpp/CfgVehicles/Car}}</code> | |x3= <code><nowiki>[</nowiki>["configFile","CfgVehicles","Car"]] [[call]] [[BIS_fnc_configPath]]; {{cc|bin\config.cpp/CfgVehicles/Car}}</code> | ||
|x4= < | |x4= <sqf>["bin\config.cpp/CfgVehicles/Car"] call BIS_fnc_configPath; // ["configFile","CfgVehicles","Car"]</sqf> | ||
|x5= < | |x5= <sqf>[configFile >> "CfgVehicles" >> "Car", ""] call BIS_fnc_configPath; // "configFile >> ""CfgVehicles"" >> ""Car"""</sqf> | ||
|x6= < | |x6= <sqf>["bin\config.cpp/CfgVehicles/Car", "", true] call BIS_fnc_configPath; // "configFile >> ""CfgVehicles"" >> ""Car"""</sqf> | ||
|x7= < | |x7= <sqf>["bin\config.cpp/CfgVehicles/Car", ""] call BIS_fnc_configPath; // "bin\config.cpp/CfgVehicles/Car"</sqf> | ||
|x8= <code><nowiki>[</nowiki>["mary", "had", "a", "little", "lamb"], "", [[true]]] [[call]] [[BIS_fnc_configPath]]; {{cc|"" invalid config}}</code> | |x8= <code><nowiki>[</nowiki>["mary", "had", "a", "little", "lamb"], "", [[true]]] [[call]] [[BIS_fnc_configPath]]; {{cc|"" invalid config}}</code> |
Revision as of 22:44, 12 July 2022
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"]
- Example 2:
[["mary", "had", "a", "little", "lamb"], ""] call BIS_fnc_configPath; // "mary >> ""had"" >> ""a"" >> ""little"" >> ""lamb"""
- Example 3:
[["configFile","CfgVehicles","Car"]] call BIS_fnc_configPath; // bin\config.cpp/CfgVehicles/Car
- Example 4:
- Example 5:
- [configFile >> "CfgVehicles" >> "Car", ""] call BIS_fnc_configPath; // "configFile >> ""CfgVehicles"" >> ""Car"""
- Example 6:
- Example 7:
- Example 8:
[["mary", "had", "a", "little", "lamb"], "", true] call BIS_fnc_configPath; // "" invalid config
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