[fpc-pascal] how to pass a procedure address and execute it?

Ewald ewald at yellowcouch.org
Thu Jan 23 20:22:12 CET 2014


On 23 Jan 2014, at 20:18, waldo kitty wrote:

> 
> i'm trying to use one routine (centralControl) to process data from two different routines (inputThis and outputThat)... the one routine (centralControl) needs to call one of two other routines (doThis or doThat)... how? :(
> 

First define a type to make your like easier:
Type
	TProcType: Procedure;

Next, adjust contralContol's prototype: procedure centralControl(var aValue : word; theRecord : somerec; whichProc: TProcType);

And you're done:-)

--
Ewald




More information about the fpc-pascal mailing list