Server Function Template: Difference between revisions
No edit summary |
No edit summary |
||
| Line 13: | Line 13: | ||
* '''arg2''': Explanation of second example argument, parameter should be in <span style="color: #408DAE"><b>int</b></span> type. | * '''arg2''': Explanation of second example argument, parameter should be in <span style="color: #408DAE"><b>int</b></span> type. | ||
* '''arg3''': Explanation of third example argument, parameter should be in <span style="color: #408DAE"><b>double</b></span> type. | * '''arg3''': Explanation of third example argument, parameter should be in <span style="color: #408DAE"><b>double</b></span> type. | ||
== Multiple Syntaxes == | |||
<syntaxhighlight lang="javascript"> | |||
mp.examples.func(arg1, arg2, arg3); | |||
</syntaxhighlight> | |||
<syntaxhighlight lang="javascript"> | |||
mp.examples.func(arg1, arg2, arg3, arg4[]); | |||
</syntaxhighlight> | |||
=== Syntax I Parameters === | |||
* '''arg1''': Explanation of example argument, parameter should be in <span style="color: #408DAE"><b>string</b></span> type. | |||
* '''arg2''': Explanation of second example argument, parameter should be in <span style="color: #408DAE"><b>int</b></span> type. | |||
* '''arg3''': Explanation of third example argument, parameter should be in <span style="color: #408DAE"><b>double</b></span> type. | |||
=== Syntax II Parameters === | |||
* '''arg1''': Explanation of example argument, parameter should be in <span style="color: #408DAE"><b>string</b></span> type. | |||
* '''arg2''': Explanation of second example argument, parameter should be in <span style="color: #408DAE"><b>int</b></span> type. | |||
* '''arg3''': Explanation of third example argument, parameter should be in <span style="color: #408DAE"><b>double</b></span> type. | |||
* '''arg4''': Explanation of fourth example argument, parameter should be in <span style="color: #408DAE"><b>array</b></span> type. | |||
=== Returned Values === | === Returned Values === | ||
| Line 25: | Line 49: | ||
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
let val = mp.examples.func("George", 1, 2.0); | let val = mp.examples.func("George", 1, 2.0); | ||
</syntaxhighlight> | |||
This is a basic explanation about what does the example below do using 2nd syntax. | |||
<syntaxhighlight lang="javascript"> | |||
let val = mp.examples.func("George", 1, 2.0, ['foo', 'bar']); | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 23:20, 4 February 2018
Server-Side
This is an example description for a server-side function template.
Syntax
mp.examples.func(arg1, arg2, arg3);
Parameters
- arg1: Explanation of example argument, parameter should be in string type.
- arg2: Explanation of second example argument, parameter should be in int type.
- arg3: Explanation of third example argument, parameter should be in double type.
Multiple Syntaxes
mp.examples.func(arg1, arg2, arg3);
mp.examples.func(arg1, arg2, arg3, arg4[]);
Syntax I Parameters
- arg1: Explanation of example argument, parameter should be in string type.
- arg2: Explanation of second example argument, parameter should be in int type.
- arg3: Explanation of third example argument, parameter should be in double type.
Syntax II Parameters
- arg1: Explanation of example argument, parameter should be in string type.
- arg2: Explanation of second example argument, parameter should be in int type.
- arg3: Explanation of third example argument, parameter should be in double type.
- arg4: Explanation of fourth example argument, parameter should be in array type.
Returned Values
- true: if the example function has been executed successfully.
- false: otherwise.
Examples
This is a basic explanation about what does the example below do.
let val = mp.examples.func("George", 1, 2.0);
This is a basic explanation about what does the example below do using 2nd syntax.
let val = mp.examples.func("George", 1, 2.0, ['foo', 'bar']);