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

waldo kitty wkitty42 at windstream.net
Fri Jan 24 22:20:42 CET 2014


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 centralControl and then calls doThis and doThat with the necessary parameters?
>>
>
> Simply change the type:
> 	Type
> 		TProc = Procedure(aRecord: somerec);
>
> Then you can call whichProc (in centralControl) with your argument of choice.

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 procedure doesn't have 
parameters at all?

-- 
NOTE: No off-list assistance is given without prior approval.
       Please keep mailing list traffic on the list unless
       private contact is specifically requested and granted.



More information about the fpc-pascal mailing list