Ryan Potts mentioned this to Rolf Blum:
RP> Instead of having
RP> Var
RP> Form1 : tForm1;
RP> In the interface I delete that and replace it with a prototype procedure
RP> or function ie:
RP> procedure ThisIsMyForm;
RP> Then at the top of the implementation section I have the following
RP> procedure/function:
RP> procedure ThisIsMyForm;
RP> begin
RP> with tForm1.create(nil) do
RP> try
RP> Showmodal;
RP> finally
RP> free;
RP> end;
RP> end;
Thanks for posting that example, Ryan. I often do it that way, too. You may
want to pass the owner as a parameter instead of using nil. That way, the
form will get freed when its owner is destroyed. Alternatively, you can pass
Application as the owner.
...Gary
--- GoldED 2.41
---------------
* Origin: Nobody expects the Flying Circus BBS! (1:2410/905)
|