BIS fnc getCfgData: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Generated by BIS_fnc_exportFunctionsToWiki)
 
m (Some wiki formatting)
 
(36 intermediate revisions by 3 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= Smart-return number, text or array value from config.
____________________________________________________________________________________________
* Default syntax works for any config.
* Alternative syntax is for working comfortably with [[Description.ext]].


| <pre>/*
|s1= config call [[BIS_fnc_getCfgData]]


Description:
|p1= config: [[Config]] - [[Config]] path
Smart-return number, text or array value from config.


Remark(s):
|r1= [[Array]], [[String]], [[Number]] or [[nil]]
* Can by called 2 ways:
* 1st way (general) works for any config.
* 2nd way is for comfortable working with mission description.ext.


Parameter(s):
|s2= array call [[BIS_fnc_getCfgData]]
_this: CFG
_this: ARRAY of STRINGS - missionConfigFile classes and an attribute.


Example:
|p21= [[Array]] of [[String]]s - [[missionConfigFile]] classes and an attribute


* 1st way of calling:
|r2= [[Array]], [[String]], [[Number]] or [[nil]]


_value = (configfile >> "BulletBubbles" >> "BulletBubbles1") call BIS_fnc_getCfgData;
|x1= <sqf>private _value = (configFile >> "BulletBubbles" >> "BulletBubbles1" >> "type") call BIS_fnc_getCfgData;</sqf>
_value = (missionconfigfile >> "Hubs" >> "A1" >> "QuickStart" >> "trigger") call BIS_fnc_getCfgData;


* 2nd way of calling:
|x2= <sqf>private _value = (missionConfigFile >> "Hubs" >> "A1" >> "QuickStart" >> "trigger") call BIS_fnc_getCfgData;</sqf>
 
_value = ["Hubs","A1","QuickStart","trigger"] call BIS_fnc_getCfgData;
 
Returns:
STRING or NUMBER or ARRAY or nil (if value not found)
*/
 
</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
____________________________________________________________________________________________
 
| <!-- [] call [[BIS_fnc_getCfgData]]; --> |= Syntax
 
|p1= |= Parameter 1
 
| |= Return value
____________________________________________________________________________________________
 
|x1= <code></code> |=
____________________________________________________________________________________________
 
| |= See also


|seealso= [[BIS_fnc_getCfgDataArray]] [[BIS_fnc_getCfgDataObject]] [[BIS_fnc_getCfgDataPool]] [[BIS_fnc_getCfgDataBool]]
}}
}}
<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>
<h3 style="display:none">Bottom Section</h3>
[[Category:Function Group: Configs|{{uc:getCfgData}}]]
[[Category:Functions|{{uc:getCfgData}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:getCfgData}}]]

Latest revision as of 22:03, 23 April 2024

Hover & click on the images for description

Description

Description:
Smart-return number, text or array value from config.
  • Default syntax works for any config.
  • Alternative syntax is for working comfortably with Description.ext.
Execution:
call
Groups:
Configs

Syntax

Syntax:
config call BIS_fnc_getCfgData
Parameters:
config: Config - Config path
Return Value:
Array, String, Number or nil

Alternative Syntax

Syntax:
array call BIS_fnc_getCfgData
Parameters:
Array of Strings - missionConfigFile classes and an attribute
Return Value:
Array, String, Number or nil

Examples

Example 1:
private _value = (configFile >> "BulletBubbles" >> "BulletBubbles1" >> "type") call BIS_fnc_getCfgData;
Example 2:
private _value = (missionConfigFile >> "Hubs" >> "A1" >> "QuickStart" >> "trigger") call BIS_fnc_getCfgData;

Additional Information

See also:
BIS_fnc_getCfgDataArray BIS_fnc_getCfgDataObject BIS_fnc_getCfgDataPool BIS_fnc_getCfgDataBool

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