config greater greater name: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
m (Fix)
 
(57 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| arma |= Game name
|game1= arma1
|version1= 1.00


|1.00|= Game version
|game2= arma2
____________________________________________________________________________________________
|version2= 1.00


|Returns subentry of config entry with given name. Identical to [[config/name]].  |= Description
|game3= arma2oa
____________________________________________________________________________________________
|version3= 1.50


| '''''config'' >> ''name'''''|= Syntax
|game4= tkoh
|version4= 1.00


| p1 = config: [[Config]]|=Parameter 1
|game5= arma3
|version5= 0.50


|p2 = name: [[String]] | = Parameter 2
|gr1= Config


|descr= Returns [[Config | config]] entry with given name (alias of [[a / b]], slightly faster but with [[Operators#Order of Precedence|lower precedence]])


| [[Config]] |= Return value
|s1= config [[config greater greater name|>>]] name
____________________________________________________________________________________________


| x1 = <code>[[configFile]] [[config greater greater name|>>]] "CfgVehicles";</code> | = Example 1
|p1= config: [[Config]]


| [[configFile]], [[config/name]], [[configName]], [[count]], [[getText]], [[isArray]], [[isClass]], [[isNumber]], [[isText]], [[select]] |= See also
|p2= name: [[String]]


}}
|r1= [[Config]] - config entry


<h3 style="display:none">Notes</h3>
|x1= <sqf>configFile >> "CfgVehicles";</sqf>
<dl class="command_description">
<!-- Note Section BEGIN -->
<dd class="notedate">Posted on Apr 3, 2014 - 00:37
<dt class="note">'''[[User:ffur2007slx2_5|ffur2007slx2_5]]'''<dd class="note">
In ArmA3 ver 1.14 there’re several comfortable workarounds with [[configFile]] for collecting subclasses. As for traditional workaround like:
<code>
(configfile >> "CfgFaces") call {
  private ["_classes"];
  _classes = [];
  for "_i" from 0 to ((count _this) - 1) do 
  {
    if (isClass (_this select _i)) then
  {
  _classes set [count _classes, configName (_this select _i)];
  };
  };
  _classes
};
//return: ["Default"……"O_Colonel"] 8 items
</code>
Alternative recommended workaround by using: [[BIS_fnc_getCfgSubClasses]] e.g.
<code>
(configfile >> "CfgFaces") call BIS_fnc_getCfgSubClasses
//Same as traditional workaround
</code>
Another powerful replacement is using [[BIS_fnc_returnChildren]] to collect grandchildren classes with desired level, e.g.
<code>
[(configfile >> "CfgFaces"),1,true,true] call BIS_fnc_returnChildren;
//Return all children faces with a total number at 68
</code>
And as for another advanced workaround for direct processing collected classes, use [[BIS_fnc_uniqueClasses]]. E.g.
<code>
my_array = [];
[(configfile >> "BombCrater"),
  {
    my_array set [count my_array,(_this select 2) call bis_fnc_getcfgdata]
  }
] call BIS_fnc_uniqueClasses;
//return [[0,0,0],[0,0,0],[0,0,0]]
</code>


<!-- Note Section END -->
|seealso= [[configFile]] [[a / b]] [[configName]] [[count]] [[getText]] [[isArray]] [[isClass]] [[isNumber]] [[isText]] [[select]] [[configClasses]]
</dl>
}}
 
<h3 style="display:none">Bottom Section</h3>
 
[[Category:Scripting Commands|#]]
[[Category:Scripting Commands ArmA|#]]
[[Category:Scripting Commands ArmA2|#]]
[[Category:Scripting Commands Arma 3|#]]
[[Category:Command_Group:_System_Commands|#]]

Latest revision as of 23:51, 29 April 2024

Hover & click on the images for description

Description

Description:
Returns config entry with given name (alias of a / b, slightly faster but with lower precedence)
Groups:
Config

Syntax

Syntax:
config >> name
Parameters:
config: Config
name: String
Return Value:
Config - config entry

Examples

Example 1:
configFile >> "CfgVehicles";

Additional Information

See also:
configFile a / b configName count getText isArray isClass isNumber isText select configClasses

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