Closed Thread
Results 1 to 6 of 6

Thread: function pointers

  1. #1
    porno.shome Guest

    Exclamation function pointers

    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

  2. CODECALL Circuit advertisement

     
  3. #2
    v0id is offline Retired
    Join Date
    Apr 2007
    Posts
    2,937
    Blog Entries
    3
    Rep Power
    42

    Re: function pointers

    Did you try Google?

  4. #3
    porno.shome Guest

    Unhappy Re: function pointers

    did try that... but was not of much help!

  5. #4
    Chinmoy's Avatar
    Chinmoy is offline Programming Expert
    Join Date
    Feb 2008
    Location
    where heaven meets earth
    Posts
    410
    Rep Power
    18

    Re: function pointers

    pointers in python! Rarely heared of that!
    God is real... unless declared an integer

  6. #5
    v0id is offline Retired
    Join Date
    Apr 2007
    Posts
    2,937
    Blog Entries
    3
    Rep Power
    42

    Re: function pointers

    Quote Originally Posted by Chinmoy
    pointers in python! Rarely heared of that!
    That's completely irrelevant for this thread. He's talking about Delphi and function pointers, so why are you talking about Python?

  7. #6
    Thor is offline Newbie
    Join Date
    Jul 2008
    Posts
    1
    Rep Power
    0

    Re: function pointers

    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

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Function Pointers
    By breimer273 in forum C and C++
    Replies: 4
    Last Post: 03-16-2011, 09:30 AM
  2. C function pointers question
    By tate in forum C and C++
    Replies: 7
    Last Post: 07-06-2010, 12:44 AM
  3. Function Pointers and Inheritance
    By cod3b3ast in forum C and C++
    Replies: 3
    Last Post: 01-12-2010, 05:37 PM
  4. Function Pointers
    By marwex89 in forum C Tutorials
    Replies: 18
    Last Post: 07-09-2009, 08:45 PM
  5. Derived Classes Can't Set Function Pointers
    By dargueta in forum C and C++
    Replies: 11
    Last Post: 11-05-2007, 07:04 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts