Users can define and use their own functions in PAscript.

User-defined functions are structured according to the following outline:

function definition of return values = function name
                                        (type parameter1, ..., type parameter_n)
  // implementation code
endfunction

The content between the keywords function and endfunction completely defines the function.

All user-defined functions must be defined outside the body of the program, which means after the keyword endprogram.

The function names must not be PAscript keywords (if, cos, sprintf, etc.).

The structure of the function names corresponds to the structure of standard names in PAtools.