Lost Password?

Go Back   CodeCall Programming Forum > Software Development > Pascal/Delphi

Pascal/Delphi Forum for discussing Borland Delphi and Pascal coding techniques, tips and tricks.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-23-2008, 12:13 AM
porno.shome porno.shome is offline
Newbie
 
Join Date: Apr 2008
Posts: 4
Credits: 0
Rep Power: 0
porno.shome is on a distinguished road
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 04-23-2008, 12:42 AM
v0id's Avatar   
v0id v0id is offline
<img src="http://forum.codecall.net/images/userbar/supermod.png" alt="Super Moderator">
 
Join Date: Apr 2007
Location: Denmark
Posts: 2,471
Last Blog:
CherryPy(thon)
Credits: 0
Rep Power: 27
v0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of light
Send a message via MSN to v0id
Default Re: function pointers

Did you try Google?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-23-2008, 03:24 AM
porno.shome porno.shome is offline
Newbie
 
Join Date: Apr 2008
Posts: 4
Credits: 0
Rep Power: 0
porno.shome is on a distinguished road
Unhappy Re: function pointers

did try that... but was not of much help!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 05-05-2008, 05:02 AM
Chinmoy's Avatar   
Chinmoy Chinmoy is offline
Programming Professional
 
Join Date: Feb 2008
Location: where heaven meets earth
Posts: 301
Credits: 20
Rep Power: 6
Chinmoy has a spectacular aura aboutChinmoy has a spectacular aura about
Default Re: function pointers

pointers in python! Rarely heared of that!
__________________
God is real... unless declared an integer
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 05-05-2008, 08:25 AM
v0id's Avatar   
v0id v0id is offline
<img src="http://forum.codecall.net/images/userbar/supermod.png" alt="Super Moderator">
 
Join Date: Apr 2007
Location: Denmark
Posts: 2,471
Last Blog:
CherryPy(thon)
Credits: 0
Rep Power: 27
v0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of light
Send a message via MSN to v0id
Default 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?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #6 (permalink)  
Old 07-26-2008, 02:42 AM
Thor Thor is offline
Newbie
 
Join Date: Jul 2008
Posts: 1
Credits: 0
Rep Power: 0
Thor is on a distinguished road
Default 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 02:43 AM. Reason: CR/LF added
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Inline function Chinmoy C Tutorials 1 04-07-2008 03:13 PM
using Template function Chinmoy C Tutorials 4 04-03-2008 04:16 AM
function pointer Chinmoy C Tutorials 0 03-19-2008 12:52 AM
Derived Classes Can't Set Function Pointers dargueta C and C++ 11 11-05-2007 09:04 PM


All times are GMT -5. The time now is 01:33 PM.

Contest Stats

Xav ........ 213.39
chili5 ........ 80.87
morefood2001 ........ 57.41
John ........ 52.33
gamiR ........ 40.76
MeTh0Dz|Reb0rn ........ 40.7
-MW- ........ 40
WingedPanther ........ 35.4
gaylo565 ........ 24
RyanTuosto ........ 23.34

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 68%

Ads