[email protected] wrote:
On Wed, Apr 14, 2010 at 01:53:55PM +0200, Graeme Geldenhuys wrote:
  
On 14 April 2010 13:09, Kjow  wrote:
    
Is it possible?
      
Yes, but there is an alternative too. Very non-OOP, but Lazarus and
Delphi enforce it for form creation (and requirement by form
designer). In your unit with the TMainForm, there should be a lovely
global instance variable called MainForm that you can access from
everywhere. 
    

Little bit OT:

Is this global var really neccessary? Normally I delete all those
variables in my Delphi projects and create my forms on the fly and
everything works fine. 

Is this really a requirement for the lazarus form designer?

regards,

  Stefan
  
Only for auto created forms as others have said.  They probably don't make sense if you are writing a big, complicated application.  For small, simple applications they are a convenience, like hundreds of other things in Lazarus (or Delphi, for that matter) that some people like and others hate.  I used to write "smallish" in-house applications for the company I (then) worked for (in my "spare time" as a DBA) , and now write mostly for myself.  I find them very convenient.  (Remember "RAD" ?)

BTW, is it really accurate to call them "global" ?  You still have to 'use' the unit that defines them to see them.

cheers,
John Sunderland
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to