Description:
Define a named function block.
Syntax:
func fn(arg,...)
Note:
The function defines a function block (a subprogram) whose name is fn while specifying parameters that will not be entered into cell, and returns a result or not. The return statement is used to return the result set of executing the function and close the function block. When the subprogram is successfully executed, value of the last cell in the function block will be returned by default if there isn’t a return statement.
Parameter:
fn |
Function name |
arg,… |
Specified parameters |
Return value:
Result of executing a program
Example:
|
A |
B |
|
1 |
func test(num1,num2) |
|
Define a subprogram, whose parameters passed in is a sequence, and return the concatenation of members of the sequence. |
2 |
|
return num1*num2 |
Related function: