BIS fnc configPath: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (1 revision)
(format)
Line 8: Line 8:
____________________________________________________________________________________________
____________________________________________________________________________________________


| <pre>/*
|Returns config path to given entry in given format |= Description
____________________________________________________________________________________________


Description:
|  [config, format, strict] call [[BIS_fnc_configPath]]; |= Syntax
Return config path to given entry.


Parameter(s):
|p1= config: [[Array]], [[String]] or [[Config]] - input config |= Parameter 1
0: CONFIG or ARRAY or STRING
|p2= format (Optional): [[Array]], [[String]] or [[Config]] - desired format of output. Default: [[Array]], unless [[Array]] is input, then [[Config]] is returned (see Example 1) |= Parameter 2
1 (Optional): ARRAY or STRING or CONFIG - type of returned value (default: ARRAY)
|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 |= Parameter 3


Returns:
|[[Array]], [[String]] or [[Config]] |= Return value
ARRAY - list of classes (e.g., ["configfile","CfgVehicles"])
STRING - composed path (e.g., "configfile >> 'CfgVehicles'")
CONFIG - system path (e.g., configfile >> "CfgVehicles")
*/
 
</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
____________________________________________________________________________________________
____________________________________________________________________________________________


| <!-- [] call [[BIS_fnc_configPath]]; --> |= Syntax
|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
|p1= |= Parameter 1
["bin\config.cpp/CfgVehicles/Car"] [[call]] [[BIS_fnc_configPath]]; // ["configFile","CfgVehicles","Car"]
 
[configFile >> "CfgVehicles" >> "Car", ""] [[call]] [[BIS_fnc_configPath]]; // "configFile >> ""CfgVehicles"" >> ""Car"""</code> |=  
| |= Return value
____________________________________________________________________________________________


|x1= <code></code> |=  
|x2= <code><nowiki>[</nowiki>["mary", "had", "a", "little", "lamb"], ""] [[call]] [[BIS_fnc_configPath]]; // "mary >> ""had"" >> ""a"" >> ""little"" >> ""lamb"""
<nowiki>[</nowiki>["mary", "had", "a", "little", "lamb"], "", [[true]]] [[call]] [[BIS_fnc_configPath]]; // "" invalid config
<nowiki>[</nowiki>["mary", "had", "a", "little", "lamb"], []] [[call]] [[BIS_fnc_configPath]]; // ["mary", "had", "a", "little", "lamb"]
<nowiki>[</nowiki>["mary", "had", "a", "little", "lamb"], [], [[true]]] [[call]] [[BIS_fnc_configPath]]; // [""] invalid config</code> |=  
____________________________________________________________________________________________
____________________________________________________________________________________________


| |= See also
|[[configHierarchy]] |= See also


}}
}}

Revision as of 14:53, 19 December 2016


Hover & click on the images for description

Description

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

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 [["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

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

Notes

Bottom Section