The result of a function can be set by setting the result variable: this can be the function identifier or, (only in ObjFPC or Delphi mode) the special Result identifier:
In Delphi or ObjFPC mode, the above can also be coded as:
As an extension to Delphi syntax, the ObjFPC mode also supports a special extension of the Exit procedure:
The Exit call sets the result of the function and jumps to the final End of the function declaration block. It can be seen as the equivalent of the C return instruction.