[Lazarus] Commercial components for Lazarus

cc_ at freemail.hu cc_ at freemail.hu
Wed Oct 29 12:33:25 CET 2008


No, there's no problem. A typed constant is allocated just like a
global variable (or a static local variable in C).
The syntax is hackish, but the functionality is nice, indeed.

-Flávio

2008/10/28 Jalal <jalsalihi at yahoo.com>:
> There is a flaw in the code suggested below. To accomplish what you seem to
> want, the SHOWED_FIRST_TIME variable needs to be an instance variable rather
> than a local variable as declared below.
>
> That is, the SHOWED_FIRST_TIME variable should be declared in the class
> definition of the form.
>
> Using a local variable as below may work, but if so it works by chance due
> to the memory location the compiler is using for that local variable being
> static. In Delphi it would likely be a register variable, so the value would
> be unpredictable. The compiler would issue a hint too.
>
> Dave Coventry rašė:
>> Hi,
>>
>> How can I tell when my application has loaded and I can start
>> initializing some of the form elements?
>>
>> At the moment I place all of the initialization routines in the
>> FormCreate but quite often I get an 'external SIGSEHV' exception
> as
>> the mouse generates a false onSelection event on a StringGrid,
>> presumably because the StringGrid has yet to be fully loaded.
>
>   If form is non modal then I do that in OnShow event, like this:
>
> // when form appears
> procedure TfrMain.FormShow(Sender: TObject);
> const
>    SHOWED_FIRST_TIME: Boolean=False;
> begin
>      if (not SHOWED_FIRST_TIME) then begin
>          SHOWED_FIRST_TIME:=True;
>
>          // initializing
>
>      end;
> end;
>
> --
>    Valdas Jankūnas
>
> _______________________________________________
> Lazarus mailing list
> Lazarus at lazarus.freepascal.org
> http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
>
>




More information about the Lazarus mailing list