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

2014-01-24 Thread waldo kitty
On 1/23/2014 2:18 PM, waldo kitty wrote: following up on this, how do i pass parameters to doThis and doThat?? do i have to use an intermediate pre_doThis and pre_doThat which handles the calls from centralControl and then calls doThis and doThat with the necessary parameters? type TProc =

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

2014-01-24 Thread Ewald
On 24 Jan 2014, at 21:20, waldo kitty wrote: On 1/23/2014 2:18 PM, waldo kitty wrote: following up on this, how do i pass parameters to doThis and doThat?? do i have to use an intermediate pre_doThis and pre_doThat which handles the calls from centralControl and then calls doThis and

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

2014-01-24 Thread waldo kitty
On 1/24/2014 3:18 PM, Ewald wrote: On 24 Jan 2014, at 21:20, waldo kitty wrote: On 1/23/2014 2:18 PM, waldo kitty wrote: following up on this, how do i pass parameters to doThis and doThat?? do i have to use an intermediate pre_doThis and pre_doThat which handles the calls from

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

2014-01-24 Thread Ewald
On 24 Jan 2014, at 22:20, waldo kitty wrote: On 1/24/2014 3:18 PM, Ewald wrote: On 24 Jan 2014, at 21:20, waldo kitty wrote: On 1/23/2014 2:18 PM, waldo kitty wrote: following up on this, how do i pass parameters to doThis and doThat?? do i have to use an intermediate pre_doThis and

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

2014-01-24 Thread leledumbo
ahhh! that helps to explain what the compiler error was that i was seeing... so i may need two different types if each procedure called from centralControl has different parameters? won't that cause a conflict if the parameters are not the same or are in different ordering or even if some

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

2014-01-23 Thread waldo kitty
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? :( procedure doThis; begin end; procedure doThat; begin end;

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

2014-01-23 Thread Ewald
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

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

2014-01-23 Thread Marco van de Voort
In our previous episode, waldo kitty said: 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 whichproc is typeless and thus roughly equal to a

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

2014-01-23 Thread Jim Leonard
On 1/23/2014 1:27 PM, Marco van de Voort wrote: Define a procedure type that matches both procedures, in your example Type TProc = procedure ; // which is predefined in system afaik. and change whichproc to that type. The VAR is not necessary in this case. Alternately, switch to an OOP

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

2014-01-23 Thread waldo kitty
On 1/23/2014 2:22 PM, Ewald wrote: 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

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

2014-01-23 Thread waldo kitty
On 1/23/2014 2:27 PM, Marco van de Voort wrote: In our previous episode, waldo kitty said: 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

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

2014-01-23 Thread waldo kitty
On 1/23/2014 2:32 PM, Jim Leonard wrote: On 1/23/2014 1:27 PM, Marco van de Voort wrote: Define a procedure type that matches both procedures, in your example Type TProc = procedure ; // which is predefined in system afaik. and change whichproc to that type. The VAR is not necessary in