Solved

procedures calling

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
creating threads in delphi 1 136
Delphi: making a BW image transparent 10 62
Microsoft Access 97 and Delphi XE2 9 56
MS Access from Delphi 31 61
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…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

828 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