Evaluation Order of Functional Expressions

Functional expression are evaluated in stages. Evaluation starts with the most nested argument, and works outwards. If the innermost nest consists of several arguments, the arguments are evaluated from left to right. To change the order of evaluation, use parentheses to change the nesting level.

Consider the following example:


Because TelNo is the first argument of the innermost nest, the value of TelNo is determined first. If TelNo is a character-type field whose value is '416-555-1212', then the expression is treated as if it reads


The other arguments of the innermost nest are literals, so $left is now evaluated, returning the result '416', a character string. The expression is now treated as if it reads


If the value of var1 is 400 and the value of var2 is 1, then the second argument of $minof evaluates to 401:


Because one of the operands of the $minof function is numeric, all the other operands must be converted. The character string '416' is therefore converted to the number 416:


Finally, the $minof function is applied, returning the result 401.