Reputation: 3578
Why this code is not working:
procedure TFormNotification.Button3Click(Sender: TObject);
begin
FormB.Show;
end;
I'm getting Undeclared identifier error.
Upvotes: 3
Views: 19092
Reputation: 613541
You need to add the unit in which FormB is declared to your uses clause.
Upvotes: 5
Reputation: 163357
You probably have a global variable named FormB
declared in the interface
section of a unit named UnitB
. But UnitA
doesn't know anything about that unit or its contents. In particular, it doesn't know what the word FormB
means — that identifier is undeclared.
To tell UnitA
about the things declared in UnitB
, add UnitB
to the uses clause in UnitA
:
uses Windows, SysUtils, Forms, Classes, UnitB;
Upvotes: 11