I have the following problem:
unit Unit1;
...
uses Unit2;
...
procedure FormA.FormCreate(Sender: TObject);
begin
...
ReadFromINIFile;
...
end;
Unit2
procedure ReadFromIniFile;
begin
...
FormA.ChkThis (*********Problem*************)
end;
The variable FormA is not assigned until after the formCreate is finished.
It seems that the OnCreate also calls the OnShow and OnActivate so they
won't work either for the same reason. I would prefer not to have to move
ReadFromINIFile to Unit1.
Has anyone got any ideas?
Thanks.
Tom.
Only an idea:
Try moving it to OnShow() or OnActivate(), I had this problem a while
back, and fixed it like this. BTW I believe that Onshow is called
*after* OnCreate...
Any help
Rowland
--
============================================+===========================
Uni: mailto:***************** | Always be sincere -
Home: mailto:Row...@netcomuk.co.uk | Whether you mean it or not
Web: http://www.netcomuk.co.uk/~rowland/ |
OnShow and OnActivate can be called many times so it is necessary to have
a "FirstEntry flag" to stop initialisation code being executed many times.
John.