next up previous contents index
Next: Open array parameters Up: Using functions and procedures Previous: Function overloading

Const parameters

In addition to var parameters and normal parameters (call by value, call by reference), Free Pascal also supports Const parameters. You can specify a Const parameter as follows:

Function Name (Const S: Type_Of_S) : ResultType
A constant argument is passed by refenence (i.e. the function or procedure receives a pointer to the passed , but you are not allowed to assign to it, this will result in a compiler error.

The main use for this is reducing the stack size, hence improving performance.



Michael Van Canneyt
Thu Sep 10 14:02:43 CEST 1998