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 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:-)

damn! i was so close so many times! i did try using "pointer" as the type with and without 'var' for whichProc... this will be a huge savings in time and code size! thanks!

--
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.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to