[fpc-pascal] Initialize object variables
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;
> 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
I think objects are allocated on the stack (not the heap), but that does
not help in circumventing the init method to initialize them.
More information about the fpc-pascal