[fpc-pascal] Turbo Pascal and Object Pascal ways of OOP

Tiziano De Togni tizzziano at tiscali.it
Tue Feb 5 12:02:24 CET 2008


Michael Van Canneyt ha scritto:
> 
> On Tue, 5 Feb 2008, Tiziano De Togni wrote:
> 
>> From the Delphi (7) help and in the borland newgroups I read that the old TP
>> style object type is considered to disappear, and actually only kept for code
>> compatibility.
>>
>> I see here that some developers still use the type object because of some
>> advantages against the Class type (static allocation).
>>
>> Can someone explain better these advantages?
> 
> The advantage is mainly that you can have objects on the stack.

sorry, but don't understand exactly what this means exactly.

I understand that if I write a procedure of this kind:

procedure processmyobject(myobject: tmyobject);

procedure processmyobject(myclass: tmyclass);

I have myobject on the stack, instead myclass is passed by reference, 
but don't see the advantage...

-- 
tiziano
______________________________________
http://digilander.libero.it/tizzziano/



More information about the fpc-pascal mailing list