Solved

procedures calling

Posted on 1997-06-17
1
136 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

743 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