supportInfo: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(made my note clearer)
m (Text replacement - "\{\{Feature *\| *Informative *\| ([^↵]+) *\}\}" to "{{Feature|informative|$1}}")
 
(73 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command
____________________________________________________________________________________________


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


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


|gr1= System |GROUP1=
|game3= arma2oa
____________________________________________________________________________________________
|version3= 1.50


| Creates a list of supported operators and type. Each field of array has the format: "x:name" Where x can be:
|game4= tkoh
|version4= 1.00
 
|game5= arma3
|version5= 0.50
 
|gr1= System
 
|descr= Creates a list of supported operators and type. Each field of array has the format: "x:name" Where x can be:
*'t' - type
*'t' - type
*'n' - [[SQF_syntax#Nular_Operators|nullar]] operator
*'n' - [[SQF Syntax#Nular_Operators|nullar]] operator
*'u' - [[SQF_syntax#Unary_Operators|unary]] operator
*'u' - [[SQF Syntax#Unary_Operators|unary]] operator
*'b' - [[SQF_syntax#Binary_Operators|binary]] operator.
*'b' - [[SQF Syntax#Binary_Operators|binary]] operator.


'name' is the operator or type name (in case operator, type of input operands is included).  
'name' is the operator or type name (in case operator, type of input operands is included).  
''mask'' parameter can be an empty string, or one of field. In this case, function returns empty array, if operator is not included in the list. Limited wildcard support is available. Type ''x'' may be replaced with ''*'', meaning all types. For the ''mask'' partial match may be used, like ''abc*'', meaning any operators starting with 'abc' are reported, for example:  
''mask'' parameter can be an empty string, or one of field. In this case, function returns empty array, if operator is not included in the list. Limited wildcard support is available. Type ''x'' may be replaced with ''*'', meaning all types. For the ''mask'' partial match may be used, like ''abc*'', meaning any operators starting with 'abc' are reported, for example:  
* <tt>""</tt> - list all types and commands
* {{hl|""}} - list all types and commands
* <tt>"t:*"</tt> - list all types
* {{hl|"t:*"}} - list all types
* <tt>"*:&lt;command&gt;*"</tt> - list all entries for script ''&lt;command&gt;''
* {{hl|"*:&lt;command&gt;*"}} - list all entries for script ''&lt;command&gt;''
* <tt>"i:&lt;command&gt;"</tt> - extended information about script ''&lt;command&gt;'', [[Array]] of [[Array]] of [[String]]s in format:{{since|arma3|1.99146528|y}}<br>[type, lowerCaseName, camelCaseName, description, example, result, resultType, leftArgType, rightArgType, syntax ({{since|arma3|2.01.146751}})]
* {{GVI|arma3|2.00|size= 0.75}} {{hl|"i:&lt;command&gt;"}} - extended information about script ''&lt;command&gt;'', [[Array]] of [[Array]] of [[String]]s in format:<br>[type, lowerCaseName, camelCaseName, description, example, result, resultType, leftArgType, rightArgType, {{GVI|arma3|2.02|size= 0.75}} syntax]
{{Informative | <tt>"i:*"</tt> is not a wildcard but returns information about the [[a * b|multiplication operator]] instead.}} |DESCRIPTION=
{{Feature|informative|{{hl|"i:*"}} is not a wildcard but returns information about the [[a * b|multiplication operator]] instead.}}
____________________________________________________________________________________________
 
|s1= [[supportInfo]] mask


| '''supportInfo''' mask |SYNTAX=
|p1= mask: [[String]]


|p1= mask: [[String]] |PARAMETER1=
|r1= [[Array]] - array with requested info or empty array {{hl|[]}}


| [[Array]] - array with requested info or empty array <tt>[]</tt> |RETURNVALUE=
|x1= <sqf>supportInfo "b:select*"; // returns ["b:ARRAY select SCALAR","b:ARRAY select BOOL","b:CONFIG select SCALAR"]</sqf>
____________________________________________________________________________________________
 
|x1= <code>[[supportInfo]] "b:select*"; {{cc|returns ["b:ARRAY select SCALAR","b:ARRAY select BOOL","b:CONFIG select SCALAR"]}}</code> |EXAMPLE1=


|x2= Return all available commands: <code>_commands = [[supportInfo]] "";</code> |EXAMPLE2=
|x2= Return all available commands:
____________________________________________________________________________________________
<sqf>_commands = supportInfo "";</sqf>


| [[productVersion]], [[requiredVersion]] |SEEALSO=
|seealso= [[productVersion]] [[requiredVersion]]
}}
}}


<h3 style="display:none">Notes</h3>
{{Note
 
|user= Killzone_Kid
<h3 style="display:none">Bottom Section</h3>
|timestamp= 20140924192700
[[Category:Scripting Commands Arma 2|{{uc:{{PAGENAME}}}}]]
|text= To get the list of all supported commands in {{arma3}} one can simply:
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
<sqf>{ diag_log _x } forEach supportInfo "";</sqf>
[[Category:Scripting Commands Take On Helicopters|{{uc:{{PAGENAME}}}}]]
}}
 
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on September 24, 2014 - 19:27 (UTC)</dd>
<dt class="note">[[User:Killzone Kid|Killzone Kid]]</dt>
<dd class="note">
To get the list of all supported commands in Arma 3 one can simply:
<code>{ [[diag_log]] _x } [[forEach]] [[supportInfo]] "";</code>
</dd>


<dd class="notedate">Posted on October 19, 2020 - 10:23 (UTC)</dd>
{{Note
<dt class="note">[[User:7erra|7erra]]</dt>
|user= 7erra
<dd class="note">
|timestamp= 20201019102300
Since you can't use {{Inline code|[[supportInfo]] "i:*"}} as a wildcard to get a list of all commands with detailed information, use this code instead:
|text= Since you can't use <sqf inline>supportInfo "i:*"</sqf> as a wildcard to get a list of all commands with detailed information, use this code instead:
<code>_allCommands {{=}} [];
<sqf>
[[supportInfo]] "" [[apply]] {
_allCommands = [];
_x [[splitString]] ":" [[params]] ["_t", "_x"];
supportInfo "" apply {
[[if]] (_t !{{=}} "t") [[then]] {
_x splitString ":" params ["_t", "_x"];
_x {{=}} _x [[splitString]] " ";
if (_t != "t") then {
_command {{=}} [[switch]] [[count]] _x [[do]] {
_x = _x splitString " ";
[[case]] 1;
_command = switch count _x do {
[[case]] 2: { _x [[a_hash_b|#]] 0 };
case 1;
[[case]] 3: { _x [[a_hash_b|#]] 1 };
case 2: { _x # 0 };
[[default]] {[[nil]]};
case 3: { _x # 1 };
default {nil};
};
};
_allCommands [[pushBackUnique]] _command;
_allCommands pushBackUnique _command;
};
};
};
};
_allCommands [[sort]] [[true]];
_allCommands sort true;
_allCommands {{=}} _allCommands [[apply]] {
_allCommands = _allCommands apply {
[[supportInfo]] [[format]]["i:%1", _x]
supportInfo format["i:%1", _x]
};
};
_allCommands </code>
_allCommands;
</dd>
</sqf>
</dl>
}}
<!-- DISCONTINUE Notes -->

Latest revision as of 18:11, 15 March 2024

Hover & click on the images for description

Description

Description:
Creates a list of supported operators and type. Each field of array has the format: "x:name" Where x can be: 'name' is the operator or type name (in case operator, type of input operands is included). mask parameter can be an empty string, or one of field. In this case, function returns empty array, if operator is not included in the list. Limited wildcard support is available. Type x may be replaced with *, meaning all types. For the mask partial match may be used, like abc*, meaning any operators starting with 'abc' are reported, for example:
  • "" - list all types and commands
  • "t:*" - list all types
  • "*:<command>*" - list all entries for script <command>
  • Arma 3 logo black.png2.00 "i:<command>" - extended information about script <command>, Array of Array of Strings in format:
    [type, lowerCaseName, camelCaseName, description, example, result, resultType, leftArgType, rightArgType, Arma 3 logo black.png2.02 syntax]
"i:*" is not a wildcard but returns information about the multiplication operator instead.
Groups:
System

Syntax

Syntax:
supportInfo mask
Parameters:
mask: String
Return Value:
Array - array with requested info or empty array []

Examples

Example 1:
supportInfo "b:select*"; // returns ["b:ARRAY select SCALAR","b:ARRAY select BOOL","b:CONFIG select SCALAR"]
Example 2:
Return all available commands:
_commands = supportInfo "";

Additional Information

See also:
productVersion requiredVersion

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
Killzone_Kid - c
Posted on Sep 24, 2014 - 19:27 (UTC)
To get the list of all supported commands in Arma 3 one can simply:
{ diag_log _x } forEach supportInfo "";
7erra - c
Posted on Oct 19, 2020 - 10:23 (UTC)
Since you can't use supportInfo "i:*" as a wildcard to get a list of all commands with detailed information, use this code instead:
_allCommands = []; supportInfo "" apply { _x splitString ":" params ["_t", "_x"]; if (_t != "t") then { _x = _x splitString " "; _command = switch count _x do { case 1; case 2: { _x # 0 }; case 3: { _x # 1 }; default {nil}; }; _allCommands pushBackUnique _command; }; }; _allCommands sort true; _allCommands = _allCommands apply { supportInfo format["i:%1", _x] }; _allCommands;