[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 190
  • Last Modified:

Procedures in a different unit

Dear all,
I have created a newunit using File|New unit and written some of my useful procedures in the unit. However when I wanted to use those procedures, I get error message " Undeclared Identifier".

I have included this unit in the Implentation section of my project. So what am I doing wrong ?

Thanks
Nadeem
0
drnadeem
Asked:
drnadeem
1 Solution
 
kretzschmarCommented:
hi drnedam,

in your unit, is there something in your interfacepart like this sample:

unit UnitX;
interface

Procedure WhatEver;

implementation

Procedure WhatEver;
Begin
  SomeCode;
end;

end.

if not, then copy the procedure/function lines from your implementationart in the interfacepart.

meikl
0
 
Dmitry_Commented:
put the declaration of yor function on the interface oart of the unit

unit MyUnit;
interface
procedure Hello;
implementation
procedure Hello;
begin
  //Your code here
end;
end.

unit Unit1;
....
....
....
implementation
uses MyUnit;

....
....
....
  Hello;
....
....
end.
0
 
nricoCommented:
Ummmm... Dmitry, that's exactly what kretzschmar had _already_ suggested.
Don't try to run off with the points.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now