BIS fnc configPath: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Generated by BIS_fnc_exportFunctionsToWiki)
 
m (Some wiki formatting)
 
(34 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{RV|type=function


{{Function|= Comments
|game1= arma3
____________________________________________________________________________________________
|version1= 1.00


| arma3 |= Game name
|gr1= Configs


|1.00|= Game version
|descr= Returns config path to given entry in given format.
____________________________________________________________________________________________


| <pre>/*
|s1= [config, format, strict] call [[BIS_fnc_configPath]]


Description:
|p1= config: [[Array]], [[String]] or [[Config]] - input config
Return config path to given entry.


Parameter(s):
|p2= format: [[Array]], [[String]] or [[Config]] - (Optional, default <sqf inline>[]</sqf> or <sqf inline>configNull</sqf> if ''config'' is [[Array]] - see {{Link|#Example 1}}) desired format of output
0: CONFIG or ARRAY or STRING
1 (Optional): ARRAY or STRING or CONFIG - type of returned value (default: ARRAY)


Returns:
|p3= strict: [[Boolean]] - (Optional, default [[false]]) if false, the function will not attempt to construct a valid config before certain format conversions (see {{Link|#Example 2}}).
ARRAY - list of classes (e.g., ["configfile","CfgVehicles"])
Set this param to [[true]] to invoke the strict mode
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
|r1= [[Array]], [[String]] or [[Config]]
____________________________________________________________________________________________


| <!-- [] call [[BIS_fnc_configPath]]; --> |= Syntax
|x1= <sqf>["configFile >> ""CfgVehicles"" >> ""Car"""] call BIS_fnc_configPath; // ["configFile","CfgVehicles","Car"]</sqf>


|p1= |= Parameter 1
|x2= <sqf>[["mary", "had", "a", "little", "lamb"], ""] call BIS_fnc_configPath; // "mary >> ""had"" >> ""a"" >> ""little"" >> ""lamb"""</sqf>


| |= Return value
|x3= <sqf>[["configFile","CfgVehicles","Car"]] call BIS_fnc_configPath; // bin\config.cpp/CfgVehicles/Car</sqf>
____________________________________________________________________________________________


|x1= <code></code> |=
|x4= <sqf>["bin\config.cpp/CfgVehicles/Car"] call BIS_fnc_configPath; // ["configFile","CfgVehicles","Car"]</sqf>
____________________________________________________________________________________________


| |= See also
|x5= <sqf>[configFile >> "CfgVehicles" >> "Car", ""] call BIS_fnc_configPath; // "configFile >> ""CfgVehicles"" >> ""Car"""</sqf>


}}
|x6= <sqf>["bin\config.cpp/CfgVehicles/Car", "", true] call BIS_fnc_configPath; // "configFile >> ""CfgVehicles"" >> ""Car"""</sqf>


<h3 style="display:none">Notes</h3>
|x7= <sqf>["bin\config.cpp/CfgVehicles/Car", ""] call BIS_fnc_configPath; // "bin\config.cpp/CfgVehicles/Car"</sqf>
<dl class="command_description">
<!-- Note Section BEGIN -->


<!-- Note Section END -->
|x8= <sqf>[["mary", "had", "a", "little", "lamb"], "", true] call BIS_fnc_configPath; // "" invalid config</sqf>
</dl>


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

Latest revision as of 16:34, 13 July 2022

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: Array, String or Config - (Optional, default [] or configNull if config is Array - see Example 1) desired format of output
strict: Boolean - (Optional, default false) if false, 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