BIS fnc configPath: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " {2,}\}\}" to " }}")
m (examples were split into 8 instead of 2 as before)
Line 7: Line 7:
|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]];
Line 17: Line 17:
|[[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]]; {{cc|["configFile","CfgVehicles","Car"]}}</code>
<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"]
[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]]; {{cc|"mary >> ""had"" >> ""a"" >> ""little"" >> ""lamb"""}}</code>
<nowiki>[</nowiki>["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"""</code>


|[[configHierarchy]]
|x3= <code><nowiki>[</nowiki>["configFile","CfgVehicles","Car"]] [[call]] [[BIS_fnc_configPath]]; {{cc|bin\config.cpp/CfgVehicles/Car}}</code>
 
|x4= <code>["bin\config.cpp/CfgVehicles/Car"] [[call]] [[BIS_fnc_configPath]]; {{cc|["configFile","CfgVehicles","Car"]}}</code>
 
|x5= <code>[configFile >> "CfgVehicles" >> "Car", ""] [[call]] [[BIS_fnc_configPath]]; {{cc|"configFile >> ""CfgVehicles"" >> ""Car"""}}</code>
 
|x6= <code>["bin\config.cpp/CfgVehicles/Car", "", [[true]]] [[call]] [[BIS_fnc_configPath]]; {{cc|"configFile >> ""CfgVehicles"" >> ""Car"""}}</code>
 
|x7= <code>["bin\config.cpp/CfgVehicles/Car", ""] [[call]] [[BIS_fnc_configPath]]; {{cc|"bin\config.cpp/CfgVehicles/Car"}}</code>
 
|x8= <code><nowiki>[</nowiki>["mary", "had", "a", "little", "lamb"], "", [[true]]] [[call]] [[BIS_fnc_configPath]]; {{cc|"" invalid config}}</code>
 
|seealso= [[configHierarchy]]
}}
}}



Revision as of 12:57, 19 January 2021

Hover & click on the images for description

Description

Description:
Returns config path to given entry in given format.
Execution:
call
Groups:
Configs

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:
["bin\config.cpp/CfgVehicles/Car"] call BIS_fnc_configPath; // ["configFile","CfgVehicles","Car"]
Example 5:
[configFile >> "CfgVehicles" >> "Car", ""] call BIS_fnc_configPath; // "configFile >> ""CfgVehicles"" >> ""Car"""
Example 6:
["bin\config.cpp/CfgVehicles/Car", "", true] call BIS_fnc_configPath; // "configFile >> ""CfgVehicles"" >> ""Car"""
Example 7:
["bin\config.cpp/CfgVehicles/Car", ""] call BIS_fnc_configPath; // "bin\config.cpp/CfgVehicles/Car"
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