When designing a TForm
, a line is added to the form's unit declaring the form object...
var
frmMyForm: TfrmMyForm;
I don't need this form auto-created, and I intend to create multiple instances of it, and to make sure I don't make the mistake of using this declared form, I commented it out...
//var
//frmMyForm: TfrmMyForm;
I was wondering if this is safe to do? I don't see any problems, and the form designer still works fine. But could there be some trouble if I leave this out completely?
This is a very common scenario when using form inheritance. You normally don't want to instantiate derived forms from the middle of the inheritance chain.
The only place where these form variables are used (besides your code perhaps) is the dpr file and that only when the form is autocreated.
So, no problem to remove the declaration.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With