[Lazarus] Initializing my App

Jalal jalsalihi at yahoo.com
Wed Oct 29 18:45:47 CET 2008


>> > // when form appears
>> > procedure TfrMain.FormShow(Sender: TObject);
>> > const
>> >   SHOWED_FIRST_TIME: Boolean=False;
>>
>> Does this work? If this was a variable this surely wouldn't work,
>> because it's scope would be local to the procedure.
>
>scope <> lifetime
>
>afaik const are never on the stack. It should work.
>
>Mattias

Indeed, since it was declared 'const' it will work *if* only one instance of this form is created.

I maintain that this should be a class member (variable). I believe those are all initialized to zeroes too, so you'll only have the set it to True to turn on your indicator.

Of course, do whatever you want in your code.  ;-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20081029/d439089d/attachment-0007.html>


More information about the Lazarus mailing list