10.11 Return of Values

With the return instruction, every rule can be left at the current position and – if necessary – can return a value to the calling rule.

Syntax

return { <expression> } ;

<expression> is required if the rule has a return type other than void. The data type of <expression> must match the return type of the rule.

Example

rule integer Addivide (integer Arg1 input, integer Arg2 input,
                       integer Arg3 input)
{
  variable integer Sum;
  Sum := Arg1 + Arg2;
  if (Arg3 <> 0) then
    return (Sum / Arg3);
  endif
  return (0);
}