Jump to content
Sign in to follow this  
chronicsilence

Iterating through all entries in a Cfg

Recommended Posts

Let's say I have a Cfg defined:

 class CfgCustomThings
   {
class thing1
{
	ID = 1;
	Val = "val1";
};
class thing2
{
	ID = 2;
	Val = "val2";
};
class thing3
{
	ID = 3;
	Val = "val3";
};
   };

Is there any way to iterate over all of the entries in the Cfg? Something like this pseudocode:

{
   hint _x >> "Val";
} forEach getArray(getText(configFile >> "CfgCustomThings"));

I just need some way to get all of the classes within the config, without listing their class names specifically, and do something with them. Thanks!

---------- Post added at 17:05 ---------- Previous post was at 17:01 ----------

Nevermind, found it hidden in the BIS functions:

BIS_fnc_getCfgSubClasses

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×