[fpc-pascal] const parameter writeable

Jonas Maebe jonas.maebe at elis.ugent.be
Mon May 1 09:58:11 CEST 2006


On 01 May 2006, at 08:11, Michael Müller wrote:

> - 'const': gives pointer, content read-only

The compiler can handle const parameters in any way it wants, and it  
may even differ among different cpu's and calling conventions.  
Sometimes they are passed by value, sometimes by reference. It  
depends on what the compiler thinks will be most efficient, or on  
what a calling convention requires.

Since the content is not writable (except by using ugly tricks, in  
which case the programmer himself is responsible for messing up  
things), that does not matter.

> - 'out': I'm not sure if it's more similar to 'var' or ''.

It's like var, except that in some cases the contents of the "out"  
parameter are erased before the function call, and that you get  
different warnings regarding the initialised status of an out  
parameter and the values that you pass to them.


Jonas


More information about the fpc-pascal mailing list