[fpc-pascal] Initialize object variables

Howard Page-Clark hdpc at talktalk.net
Thu Apr 28 11:33:16 CEST 2011


On 28/4/11 10:00, Jürgen Hestermann wrote:
>
>
> Darius Blaszyk schrieb:
>> Is there any way to initialize object variables, other than writing an
>> init method?
>> So something like:
>> myobj = object
>> myvar: word = $ffff;
>> end;
> I don't think so.
> An object is a pointer to a data structure on the heap.
> At compile time, this data structure is not yet allocated.
>
> _______________________________________________
> fpc-pascal maillist - fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
I think objects are allocated on the stack (not the heap), but that does 
not help in circumventing the init method to initialize them.

Howard



More information about the fpc-pascal mailing list