unit srcActiveFlor;
...
type
TActiveFlor = class(TForm)
procedure UpdateTables(Sender: TObject);
procedure Button1Click(sender: Tobject);
...
var
ActiveFlor: TActiveFlor;
implementation
{ TActiveFlor }
procedure TActiveFlor.Button1Click(Sender: TObject);
var
CheckForm: TcheckForm;
begin
CheckForm:=TCheckForm.create(ActiveFlor);
CheckForm.ShowModal;
CheckForm.Free;
end;
procedure TActiveFlor.UpdateTables(Sender: TObject);
begin
Label1.Caption:=inttostr(ActiveFlor.ComponentCount);//ошибка выдаеться access violation. (ActiveFlor = nil)
... //componentcount не знает с какой формы надо считать. Почему?
end;
end.
unit srcCheckForm;
interface
uses
...
type
TCheckForm = class(TForm)
procedure Button1Click(sender: Tobject);
...
var
CheckForm:TCheckForm;
implementation
{ CheckFlor }
procedure CheckForm.Button1Click(Sender: TObject);
begin
ActiveFlor.UpdateTables(Sender);
ModalResult:=mrOk;
end;
end.