ФЭНДОМ



Arma 1.00

Чтобы увидеть описание, наведите курсор на иконку

Заявлено в

Game:
Armed Assault
Version:
1.00

Описание

Описание:
Returns count of subentries.

Синтаксис

Синтаксис:
count configname
Параметры:
configname: Config
Возвращаемое значение:
Number

Примеры

Пример 1:
_count = count (configFile >> "CfgVehicles")

Дополнительная информация

Мультиплеер:
-
См. также:
configFile, config/name, configName, getArray config, getText config, getNumber config, inheritsFrom config, isArray config, isClass config, isNumber config, isText config, select config


Комментарии

Notes

+ Добавить комментарий

В комментариях следует использовать только проверенные факты.

Notes

When combined with the select command, this can be used to read all entries out of a config; even when you don't know exactly how many entries there will be. Example:

_cfg = configFile >> "CfgVehicles" >> "myclass";
for _i from 0 to (count _cfg)-1 do
{
   _nextValue = _cfg select _i;
   ...do some stuff
};

However, there are limitations here. The above code will NOT read values that are inherited from the parent of "myclass". For example, say you have the following in your config:

class CfgVehicles
{
   class parent
   {
      value1 = "something";
      value2 = "something else";
   };

   class myclass: parent
   {
      value2 = "something else new";
      value3 = "something again";
   };
};

When using the example code from above, you will only be able to read "value2" and "value3". Even though "myclass" DOES have a "value1" due to inheritance, you will NOT get that value using the example code. This is because the count and select commands only refer to the values that are directly written in to "myclass".

VBS2 users should use the fn_vbs_getInheritedCfg command as a solution to this problem. --General Barron 02:01, 3 March 2009 (CET)

Bottom Section

Материалы сообщества доступны в соответствии с условиями лицензии CC-BY-SA , если не указано иное.