In Delphi 5 it's Tools -> Environment Options, Preferences tab, Auto Create
forms check box.

Unfortunately it only stops Delphi from auto creating forms in the project
file - Delphi still creates the global variables in the form files.

Just to add my 2c worth :-). Every moderately sophisticated Delphi
application I have worked with has got it's own way of handling form
creation and referencing. This is usually through some sort custom built
FormController type object. Using Global variables just doesn't cut it. For
example with Delphi's global form variables you can't have two copies of the
form active at once, you have to write code for every form to make sure the
global variables are reset to nil when the form is freed, you have to write
long case statements if you want a central procedure for
creating/manipulating your forms, etc.

For these reasons I wish Delphi didn't create the global form variables.
They encourage beginner Delphi programmers to follow a methodology which is
bad OO style and completely lacks scalability. As someone else suggested
earlier, it would be better if Delphi provided a basic form controller,
perhaps as part of TApplication.

Comments welcome!

David Brennan.
DB Solutions Ltd.


----- Original Message -----
From: "Nello Sestini" <[EMAIL PROTECTED]>
To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]>
Sent: Thursday, May 03, 2001 10:54 AM
Subject: Re: [DUG]: Best Practice


> > Your friend and mine, the Delphi IDE automatically creates a global
> variable
> > for each form you design.
>
> ISTR there is a way to turn off this IDE behaviour but I can't find it
now.
>
> Does anyone know?
>
> -ns
>
> --------------------------------------------------------------------------
-
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED]
> with body of "unsubscribe delphi"

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"

Reply via email to