callExtension: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Reverted edits by Demellion (talk) to last revision by Str)
(wip)
Line 7: Line 7:
____________________________________________________________________________________________
____________________________________________________________________________________________


| Execute an [[Extensions|extension]] function. |= Description
| Calls custom .dll also known as [[Extensions|Extension]]. <br><br>
 
Since Arma 3 v1.67 it is possible to pass array of arguments to extension.<br>
Possible error codes:
* 101: SYNTAX_ERROR_WRONG_PARAMS_SIZE
* 102: SYNTAX_ERROR_WRONG_PARAMS_TYPE
* 201: PARAMS_ERROR_TOO_MANY_ARGS
* 301: EXECUTION_WARNING_TAKES_TOO_LONG
Each error will have entry in .rpt file as well with more details.
|= Description
____________________________________________________________________________________________
____________________________________________________________________________________________


| extension '''callExtension''' functionWithArguments |= Syntax
| extension '''callExtension''' function |= Syntax
 
|p1= extension: [[String]] - extension name |= Parameter 1
|p2= function: [[String]] - data send to the extension |= Parameter 2
 
| [[String]] - data sent back from extension |= Return value


|p1= extension: [[String]] |= Parameter 1
| s2= extension '''callExtension''' [command, arguments] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (''Since Arma 3 v1.67'') |= Syntax


|p2= functionWithArguments: [[String]] |= Parameter 2
|p21= extension: [[String]] - extension name |= Parameter 1
|p22= [command, arguments]: [[Array]]
|p23= command: [[String]] - extension command |= Parameter 2
|p24= arguments: [[Array]] - command arguments. Could be array of anything but each element will be converted to [[String]] automatically. |= Parameter 2


| [[String]] |= Return value
| r2= [[Array]] -  in format [result, returnCode, errorCode], where:
* result: [[String]] - data sent back from extension. It is up to extension maker what it is.
* returnCode: [[Number]] - integer return from extension method. It is up to extension maker to define it.
* errorCode: [[Number]] - error code in case of command error (see description). 0 means no errors.|= Return value
____________________________________________________________________________________________
____________________________________________________________________________________________


|x1= <code>handle <nowiki>=</nowiki> "pipes" '''callExtension''' "openPipe(pipe)";</code>|= EXAMPLE1  
|x1= <code>_return = "myExtension" [[callExtension]] "stringToBeParsed";</code>|= EXAMPLE1  


____________________________________________________________________________________________
____________________________________________________________________________________________


| [[Extensions|extension]], [[call]] |= SEEALSO  
| [[call]], [[compile]], [[parseSimpleArray]], [[Extensions]] |= SEEALSO  


|  |= MPBEHAVIOUR  
|  |= MPBEHAVIOUR  

Revision as of 19:53, 25 January 2017

Hover & click on the images for description

Description

Description:
Calls custom .dll also known as Extension.

Since Arma 3 v1.67 it is possible to pass array of arguments to extension.
Possible error codes:
  • 101: SYNTAX_ERROR_WRONG_PARAMS_SIZE
  • 102: SYNTAX_ERROR_WRONG_PARAMS_TYPE
  • 201: PARAMS_ERROR_TOO_MANY_ARGS
  • 301: EXECUTION_WARNING_TAKES_TOO_LONG
Each error will have entry in .rpt file as well with more details.
Groups:
Uncategorised

Syntax

Syntax:
extension callExtension function
Parameters:
extension: String - extension name
function: String - data send to the extension
Return Value:
String - data sent back from extension

Alternative Syntax

Syntax:
extension callExtension [command, arguments]         (Since Arma 3 v1.67)
Parameters:
extension: String - extension name
[command, arguments]: Array
command: String - extension command
arguments: Array - command arguments. Could be array of anything but each element will be converted to String automatically.
Return Value:
Array - in format [result, returnCode, errorCode], where:
  • result: String - data sent back from extension. It is up to extension maker what it is.
  • returnCode: Number - integer return from extension method. It is up to extension maker to define it.
  • errorCode: Number - error code in case of command error (see description). 0 means no errors.

Examples

Example 1:
_return = "myExtension" callExtension "stringToBeParsed";

Additional Information

See also:
callcompileparseSimpleArrayExtensions

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

Notes

Bottom Section