Syntax of a (non-recursive) function:
[< prefix >] FUNCTION < procname >( [< dummy args >])here < prefix >, specifies the result type. or,< declaration of dummy args >
< declaration of local objects >
...
< executable stmts, assignment of result >
[ CONTAINS
< internal procedure definitions > ]
END [ FUNCTION [ < procname > ] ]
FUNCTION < procname >( [< dummy args >])here, < procname > must be declared.< declaration of dummy args >
< declaration of result type >
< declaration of local objects >
...
< executable stmts, assignment of result >
[ CONTAINS
< internal procedure definitions > ]
END [ FUNCTION [ < procname > ] ]
For more information, click here