?
Solved

procedures calling

Posted on 1997-06-17
1
Medium Priority
?
143 Views
Last Modified: 2010-04-04
How to call procedure (or function) that is placed
(defined) in another Unit?
0
Comment
Question by:bor061297
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 4

Accepted Solution

by:
erajoj earned 100 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

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…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

800 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