[Lazarus] global items in TApplication
leledumbo
leledumbo_cool at yahoo.co.id
Sun Sep 15 06:24:11 CEST 2013
In short, you can't put it in the .dpr if you want it to be accessible from
all units. Actually, there's not really any magic behind TApplication, you
can still create your own TApplication descendant (preferably in its own
unit) and assign that to Application variable. Provide a global property to
access Application as your TApplication descendant to get its specific
features.
However, I consider this approach complicated. If you don't like global
vars, just provide getter function or read only property (property also
works at unit level in fpc), let all those variables hidden in the
implementation. A single unit that is set as application configuration is
good enough.
--
View this message in context: http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-global-items-in-TApplication-tp4033337p4033338.html
Sent from the Free Pascal - Lazarus mailing list archive at Nabble.com.
More information about the Lazarus
mailing list