Difference between revisions of "BIS fnc getCfgData"

From Bohemia Interactive Community
Jump to navigation Jump to search
m (1 revision)
m (Text replacement - " {3,}\|" to " |")
 
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
{{Function
  
{{Function|= Comments
+
| arma3
____________________________________________________________________________________________
 
  
| arma3 |= Game name
+
|1.00
  
|1.00|= Game version
+
|gr1= Configs
____________________________________________________________________________________________
 
  
| <pre>/*
+
| Smart-return number, text or array value from config.<br><br>- Default syntax works for any config.<br>
 +
- Alternative syntax is for comfortable working with mission [[description.ext]].
  
Description:
+
| config call [[BIS_fnc_getCfgData]]
Smart-return number, text or array value from config.
 
  
Remark(s):
+
|p1= config: [[Config]] - [[Config]] path
* Can by called 2 ways:
 
* 1st way (general) works for any config.
 
* 2nd way is for comfortable working with mission description.ext.
 
  
Parameter(s):
+
| [[Array]], [[String]], [[Number]] or [[nil]]
_this: CFG
 
_this: ARRAY of STRINGS - missionConfigFile classes and an attribute.
 
  
Example:
+
|exec= call
  
* 1st way of calling:
+
|s2= array call [[BIS_fnc_getCfgData]]
  
_value = (configfile >> "BulletBubbles" >> "BulletBubbles1") call BIS_fnc_getCfgData;
+
|p21= [[Array]] of [[Strings]] - [[missionConfigFile]] classes and an attribute
_value = (missionconfigfile >> "Hubs" >> "A1" >> "QuickStart" >> "trigger") call BIS_fnc_getCfgData;
 
  
* 2nd way of calling:
+
|r2= [[Array]], [[String]], [[Number]] or [[nil]]
  
_value = ["Hubs","A1","QuickStart","trigger"] call BIS_fnc_getCfgData;
+
|x1= <code> _value = ([[configFile]] >> "BulletBubbles" >> "BulletBubbles1" >> "type") [[call]] [[BIS_fnc_getCfgData]];</code>
  
Returns:
+
|x2= <code> _value = ([[missionConfigFile]] >> "Hubs" >> "A1" >> "QuickStart" >> "trigger") [[call]] [[BIS_fnc_getCfgData]];</code>
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
+
| [[BIS_fnc_getCfgDataArray]], [[BIS_fnc_getCfgDataObject]], [[BIS_fnc_getCfgDataPool]], [[BIS_fnc_getCfgDataBool]]
____________________________________________________________________________________________
+
}}
 
 
| <!-- [] call [[BIS_fnc_getCfgData]]; --> |= Syntax
 
 
 
|p1= |= Parameter 1
 
 
 
| |= Return value
 
____________________________________________________________________________________________
 
  
|x1= <code></code> |=
 
____________________________________________________________________________________________
 
  
| |= See also
 
 
}}
 
  
<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:Functions|{{uc:getCfgData}}]]
 
[[Category:{{Name|arma3}}: Functions|{{uc:getCfgData}}]]
 
[[Category:{{Name|arma3}}: Functions|{{uc:getCfgData}}]]

Latest revision as of 22:42, 18 January 2021

Introduced with Arma 3 version 1.001.00
Hover & click on the images for descriptions

Description

Description:
Smart-return number, text or array value from config.

- Default syntax works for any config.
- Alternative syntax is for comfortable working with mission description.ext.

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:
_value = (configFile >> "BulletBubbles" >> "BulletBubbles1" >> "type") call BIS_fnc_getCfgData;
Example 2:
_value = (missionConfigFile >> "Hubs" >> "A1" >> "QuickStart" >> "trigger") call BIS_fnc_getCfgData;

Additional Information

Execution:
call
See also:
BIS_fnc_getCfgDataArrayBIS_fnc_getCfgDataObjectBIS_fnc_getCfgDataPoolBIS_fnc_getCfgDataBool
Groups:
Configs

Notes

i
Only post proven facts here. Report bugs on the Feedback Tracker and discuss on the Arma Discord or on the Forums.