FUNC
defines a function with input parameters. During the execution of the function, no other variables or parameters are valid. The definition of the function must not be executed during normal execution of the script. Therefore the definition should placed after END command!
Syntax
FUNC name ( param_1, param_2 , ... , param_n)
...
RETURN ret
FUNC_END
Parameters
name
(string): name of the function
param_1 ...param_n
(string): parameters of the function
ret
(decimal or string): return value
Remarks
The function is called with name(expr_1,expr_2,...expr_n)
and gives back the value specified with RETURN
.
Example:
PRINT faculty ( 9 )
END
FUNC faculty ( a )
IF a = 1 THEN
b=1
ELSE
b= a * faculty ( a - 1 )
ENDIF
RETURN b
FUNC_END
Usable since script version 1.3 (Allplan 2013-1).
(C) ALLPLAN GmbH |
Privacy policy |