supportInfo: Difference between revisions
Jump to navigation
Jump to search
Killzone Kid (talk | contribs) No edit summary |
Lou Montana (talk | contribs) m (Text replacement - "\{\{Feature *\| *Informative *\| ([^↵]+) *\}\}" to "{{Feature|informative|$1}}") |
||
(82 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
{{ | {{RV|type=command | ||
| | |game1= arma1 | ||
|version1= 1.00 | |||
|1.00 | |game2= arma2 | ||
|version2= 1.00 | |||
| Creates a list of supported operators and type. Each field of array has the format: "x:name" Where x can be: | |game3= arma2oa | ||
|version3= 1.50 | |||
|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' - [[ | *'n' - [[SQF Syntax#Nular_Operators|nullar]] operator | ||
*'u' - [[ | *'u' - [[SQF Syntax#Unary_Operators|unary]] operator | ||
*'b' - [[ | *'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: | ||
* | * {{hl|""}} - list all types and commands | ||
* | * {{hl|"t:*"}} - list all types | ||
* | * {{hl|"*:<command>*"}} - list all entries for script ''<command>'' | ||
* {{GVI|arma3|2.00|size= 0.75}} {{hl|"i:<command>"}} - extended information about script ''<command>'', [[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] | |||
{{Feature|informative|{{hl|"i:*"}} is not a wildcard but returns information about the [[a * b|multiplication operator]] instead.}} | |||
* | |||
| | |||
| | |s1= [[supportInfo]] mask | ||
|p1= mask: [[String]] | |p1= mask: [[String]] | ||
| [[Array]] - array with requested info or empty array | |r1= [[Array]] - array with requested info or empty array {{hl|[]}} | ||
| | |||
| [ | |x1= <sqf>supportInfo "b:select*"; // returns ["b:ARRAY select SCALAR","b:ARRAY select BOOL","b:CONFIG select SCALAR"]</sqf> | ||
|x2= Return all available commands: | |||
<sqf>_commands = supportInfo "";</sqf> | |||
|seealso= [[productVersion]] [[requiredVersion]] | |||
}} | }} | ||
< | {{Note | ||
|user= Killzone_Kid | |||
|timestamp= 20140924192700 | |||
|text= To get the list of all supported commands in {{arma3}} one can simply: | |||
<sqf>{ diag_log _x } forEach supportInfo "";</sqf> | |||
}} | |||
{{Note | |||
|user= 7erra | |||
< | |timestamp= 20201019102300 | ||
[ | |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: | ||
[ | <sqf> | ||
_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; | |||
</sqf> | |||
}} |
Latest revision as of 18:11, 15 March 2024
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>
- 2.00 "i:<command>" - extended information about script <command>, Array of Array of Strings in format:
[type, lowerCaseName, camelCaseName, description, example, result, resultType, leftArgType, rightArgType, 2.02 syntax]
- 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:
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
- Posted on Sep 24, 2014 - 19:27 (UTC)
- To get the list of all supported commands in Arma 3 one can simply:
- 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;
Categories:
- Scripting Commands
- Introduced with Armed Assault version 1.00
- ArmA: Armed Assault: New Scripting Commands
- ArmA: Armed Assault: Scripting Commands
- Arma 2: Scripting Commands
- Arma 2: Operation Arrowhead: Scripting Commands
- Take On Helicopters: Scripting Commands
- Arma 3: Scripting Commands
- Command Group: System