how to declare a function pointer in Delphi?
How to pass the same to a function, as one of the parameters?
Thanks in advance!
PS
Did you try Google?
did try that... but was not of much help!
pointers in python! Rarely heared of that!
God is real... unless declared an integermy blog :: http://techarraz.com/
That's completely irrelevant for this thread. He's talking about Delphi and function pointers, so why are you talking about Python?Originally Posted by Chinmoy
This is how to do it...
/Thor
Code:program Project1; {$APPTYPE CONSOLE} uses SysUtils; type TFunctionPtr = function (P1: integer) : string; function MyFunction(P1: integer): string; begin result := IntToStr(P1); end; procedure Caller(Func: TFunctionPtr; Version: integer); begin Writeln('My current Delphi version = ' + Func(Version)); end; begin Caller(MyFunction, 10); Readln; end.
Last edited by Thor; 07-26-2008 at 12:43 AM. Reason: CR/LF added
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks