User-Defined Functions
- Updated2026-04-22
- 1 minute(s) read
Define your own functions as user-defined functions in PAscript.
User-defined functions have the following structure:
function definition of return values = FunctionName(type Parameter_1, ..., type Parameter_n) // implementation code endfunction
The content between function and endfunction completely defines the function.
Define all user-defined functions outside of the program...endprogram section of the PAscript file.
The name of the function cannot be a PAscript keyword. For example, the following cannot be function names:
- if
- cos
- sprintf
The structure of the function names corresponds to the structure of standard names in PAtools.