next up previous contents
Next: External Function Example Up: Program Units Previous: External Subroutine Example

 

Function Syntax

Syntax of a (non-recursive) function:

 
 [< prefix >] FUNCTION < procname >( [< dummy args >])

< declaration of dummy args >

< declaration of local objects >

...

< executable stmts, assignment of result >

[ CONTAINS

< internal procedure definitions > ]

END [ FUNCTION [ < procname > ] ]

here < prefix >, specifies the result type. or,
 
 FUNCTION < procname >( [< dummy args >])

< declaration of dummy args >

< declaration of result type >

< declaration of local objects >

...

< executable stmts, assignment of result >

[ CONTAINS

< internal procedure definitions > ]

END [ FUNCTION [ < procname > ] ]

here, < procname > must be declared.

For more information, click here gif


next up previous contents
Next: External Function Example Up: Program Units Previous: External Subroutine Example

©University of Liverpool, 1997
Wed May 28 23:37:18 BST 1997
Not for commercial use.