You can declare arguments to a function as local variable names. Variables declared in the function declaration, or in the function body, are local to the scope of the function call. Compared to when all variables were global, there is no risk of overwriting global variables, thus making custom functions more portable.func name([type name,]){[statements][return value]}
Example 36 func myfunc(str firstname, str lastname, num age){if (age > 29)return firstname + lastname;elsereturn 0;}It is still possible to use the #N syntax to retrieve the arguments to a function even when you use variable names as arguments..
Example 37 #N syntax when arg variables are declared{log(1, echo("hello!"));}func echo(str string){return #1;}
• Arry variables are currently not supported in function arguments or return values.
• You can not initialize argument variables in the function declaration. This must be done in the function body.
OpenText StreamServe 5.6 | Updated: 2013-03-01 |