Einzelnen Beitrag anzeigen

question

Registriert seit: 17. Apr 2013
97 Beiträge
 
#1

access private procedures

  Alt 21. Jul 2013, 20:06
Hello,
I have created a projectgroup , in this projectgroup- i have two units. I have created one procedure in unit under private declaration and I would like to call this procedure from another unit. But I have an error “cannot access private symbol…”
Could you please tell me, how to access private Procedures/Function from one unit to another ?
Here is the code:

unit CalCulation;
interface
uses
type
TCal = class(TObject)
private
procedure AddNumbers (Sender : TObject);
end;
var
MyAdd : TCal;
implementation
procedure TCal. AddNumbers (Sender : TObject);
var
t,o, Result : integer;
begin
//calculation
end;
------------------------------
unit frmShow;

procedure TForm3.Button1Click(Sender: TObject);
begin
MyAdd.AddPublic(Sender); // here is the error as it has declared as a private in other unit
end;
  Mit Zitat antworten Zitat