isClass: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\|gr1=([^ ]+) \|([0-9]\.[0-9]{2}) " to "|$2 |gr1= $1 ")
m (Some wiki formatting)
 
(24 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{RV|type=command
{{RV|type=command


| arma1
|game1= arma1
|version1= 1.00


|1.00
|game2= arma2
|version2= 1.00


|gr1= Config
|game3= arma2oa
|version3= 1.50


| Check if config entry represents config class.
|game4= tkoh
|version4= 1.00


|s1= '''isClass''' config
|game5= arma3
|version5= 0.50
 
|gr1= Config
 
|descr= Check if config entry represents config class.
 
|s1= [[isClass]] config


|p1= config: [[Config]]
|p1= config: [[Config]]
|r1= [[Boolean]]
|r1= [[Boolean]]


|x1= <code>_ok = [[isClass]] ([[configFile]] [[gtgt|>>]] "CfgVehicles");</code> Result is [[true]].
|x1= <sqf>_ok = isClass (configFile >> "CfgVehicles");</sqf> Result is [[true]].


|seealso= [[configFile]], [[config / name]], [[configName]], [[count]], [[getArray]], [[getText]], [[getNumber]], [[inheritsFrom]], [[isArray]], [[isNumber]], [[isText]], [[select]]
|seealso= [[configFile]] [[a / b]] [[configName]] [[count]] [[getArray]] [[getText]] [[getNumber]] [[inheritsFrom]] [[isArray]] [[isNumber]] [[isText]] [[select]]
}}
}}


<dl class="command_description">
{{Note
 
|user= Kronzky
<dt></dt>
|timestamp= 20070302011700
<dd class="notedate">Posted on March 2, 2007 - 01:17</dd>
|text= This command allows you to check for the presence of an addon.
<dt class="note">[[User:Kronzky|Kronzky]]</dt>
<dd class="note">This command allows you to check for the presence of an addon.
  isClass (configFile >> "cfgVehicles" >> "MyCustomCar")  
  isClass (configFile >> "cfgVehicles" >> "MyCustomCar")  
will return [[true]] if the addon "MyCustomCar" is installed, and [[false]] if it is not installed.  
will return [[true]] if the addon "MyCustomCar" is installed, and [[false]] if it is not installed.  


''You will have to know under which class the addon is categorized (in this case "cfgVehicles") to be able to use the right config path.''
''You will have to know under which class the addon is categorized (in this case "cfgVehicles") to be able to use the right config path.''
<dd class="notedate">Posted on Mar 31, 2014 - 15:45</dd>
}}
<dt class="note">[[User:ffur2007slx2_5|ffur2007slx2_5]]</dt>
 
<dd class="note">
{{Note
({{arma3}} ver 1.14) According to BI Dev Karel Mořický, [[BIS_fnc_getCfgIsClass]] provides a comfortable workaround with custom config under description.ext compared with [[isClass]]. (But as a function created specifically for A3 campaign, it is in no way intended as a replacement for [[isClass]]. So it is not suggested to use it for [[configFile]] classes. But [[isClass]] instead.)
|user= ffur2007slx2_5
|timestamp= 20140331154500
|text= ({{arma3}} ver 1.14) According to BI Dev Karel Mořický, [[BIS_fnc_getCfgIsClass]] provides a comfortable workaround with custom config under description.ext compared with [[isClass]].
(But as a function created specifically for A3 campaign, it is in no way intended as a replacement for [[isClass]].
So it is not suggested to use it for [[configFile]] classes. But [[isClass]] instead.)
E.g.
E.g.
<code>["Something1","Something2","Something3"] call bis_fnc_getCfgIsClass<br> //Same as isClass (missionconfigfile >> "Something1" >> "Something2" >> "Something3")</code>
<sqf>["Something1", "Something2", "Something3"] call BIS_fnc_getCfgIsClass; // same as isClass (missionConfigFile >> "Something1" >> "Something2" >> "Something3")</sqf>
</dl>
}}
 
{{GameCategory|arma2|Scripting Commands}}
{{GameCategory|arma3|Scripting Commands}}
{{GameCategory|tkoh|Scripting Commands}}

Latest revision as of 00:33, 14 May 2023

Hover & click on the images for description

Description

Description:
Check if config entry represents config class.
Groups:
Config

Syntax

Syntax:
isClass config
Parameters:
config: Config
Return Value:
Boolean

Examples

Example 1:
_ok = isClass (configFile >> "CfgVehicles");
Result is true.

Additional Information

See also:
configFile a / b configName count getArray getText getNumber inheritsFrom isArray isNumber isText select

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
Kronzky - c
Posted on Mar 02, 2007 - 01:17 (UTC)
This command allows you to check for the presence of an addon. isClass (configFile >> "cfgVehicles" >> "MyCustomCar") will return true if the addon "MyCustomCar" is installed, and false if it is not installed. You will have to know under which class the addon is categorized (in this case "cfgVehicles") to be able to use the right config path.
ffur2007slx2_5 - c
Posted on Mar 31, 2014 - 15:45 (UTC)
(Arma 3 ver 1.14) According to BI Dev Karel Mořický, BIS_fnc_getCfgIsClass provides a comfortable workaround with custom config under description.ext compared with isClass. (But as a function created specifically for A3 campaign, it is in no way intended as a replacement for isClass. So it is not suggested to use it for configFile classes. But isClass instead.) E.g.
["Something1", "Something2", "Something3"] call BIS_fnc_getCfgIsClass; // same as isClass (missionConfigFile >> "Something1" >> "Something2" >> "Something3")