Rexx Programming/How to Rexx/function

From Wikibooks, open books for an open world
Jump to: navigation, search

Function calls are followed by parentheses[edit]

Function calls are followed by parentheses containing optional parameters to the function. A pair of empty parentheses are used if the function has no optional parameters.

Whitespace is not allowed between a function name and its argument list[edit]

The parentheses containing function arguments must immediately follow the function name. No whitespace characters are allowed between the function name and its argument list, otherwise the function name may get misinterpreted as a variable name:

say random() /* No whitespace is allowed between the function and the parentheses */

Functions always return a result[edit]

Functions in rexx always return a result which is substituted into the expression in place of the function call after the function has been executed.