Solved

procedures calling

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

696 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