Solved

procedures calling

Posted on 1997-06-17
1
137 Views
Last Modified: 2010-04-04
How to call procedure (or function) that is placed
(defined) in another Unit?
0
Comment
Question by:bor061297
1 Comment
 
LVL 4

Accepted Solution

by:
erajoj earned 50 total points
ID: 1337132
I suppose you're familiar with the "uses" statement so:

unit main;
   .
uses Unit1...
   .
   .
procedure MyProc(Param: Integer);
begin
   .
   .
end;
   .
   .
..TMainForm.Create...
  Unit1.ExtProc := MyProc; // Copy function pointer
   .
   .
end.  

------------------------------------

unit Unit1;
   .
   .
var
  ExtProc: procedure (Param: Integer);
   .
   .
  ExtProc(123); // Calls procedure from "Main"
end.  

/// John

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now