[fpc-pascal] TObject and @TObject (are objects pointers?)

2013-09-11 Thread Xiangrong Fang
Hi, I am writing a Tree class which have the following skeleton: generic TTreeT = class private FItems: TList; public ... end; The FItems variable is used to store Children of current node. My question is: Shall I store TTree in FItems or @TTree? My understanding is: If a variable obj

Re: [fpc-pascal] TObject

2008-11-04 Thread Carsten Bager
Change to Function rSafeVar: SafeVar_typ; Joao Morais Sorry about that. I pasted the wrong code in the email. I have already changed that. It does still not compile after the change. Carsten Med venlig hilsen Carsten Bager BEAS A/S Brørupvænget 10 DK-7650 Bøvlingbjerg Tlf. : +45 9788

Re: [fpc-pascal] TObject

2008-11-04 Thread Carsten Bager
Here the Data getter is called, ie, hSafeVar, because you are reading a value from it. Use a function as a getter instead of a class member. Btw getters and setters have not the same syntax, you need to create two different methods. Was it this you meant? Now I cannot compile. If I change

Re: [fpc-pascal] TObject

2008-11-04 Thread Joao Morais
Carsten Bager wrote: Here the Data getter is called, ie, hSafeVar, because you are reading a value from it. Use a function as a getter instead of a class member. Btw getters and setters have not the same syntax, you need to create two different methods. Was it this you meant? Now I cannot

[fpc-pascal] TObject

2008-09-08 Thread Carsten Bager
A have a unit (uSafeVar) with an object. The object has a property data of the type SafeVar_typ If I do this it works (wSafeVar is called) var p:SafeVar_typ; begin p.d:=111; SafeVar.data:=p; end If I do this it dos not work but it compiles (wSafeVar is not called) begin

Re: [fpc-pascal] TObject

2008-09-08 Thread Joao Morais
Carsten Bager wrote: A have a unit (uSafeVar) with an object. The object has a property data of the type SafeVar_typ If I do this it works (wSafeVar is called) var p:SafeVar_typ; begin p.d:=111; SafeVar.data:=p; Here the Data setter is called, ie, wSafeVar, because you are assigning