On 20 May 2007, at 16:38, bartek wrote:

OK. And what about this:
-----8<-----
/home/bartek/Dev/units/glgui/glgui.pp(376,33) Error: Can't take the address of
constant expressions
-----8<-----
constructor TGLGUI3DMouseMapper.Create(aOwnerDesktop: TGLGUIDesktop);
begin
        OwnerDesktop:=aOwnerDesktop;
        OwnerDesktop.MouseMapper:=self; // 376 is here
end;
-----8<-----

Definition snippet:
-----8<-----
                // properties
property OwnerDesktop: TGLGUIDesktop read fOwnerDesktop write
fOwnerDesktop;
-----8<-----

You cannot write to fields of properties. The reason is that any property accessor should be transparently replaceable by a function call, and if you do that in the above expression then your assignment would change something inside the (temporary) function result rather than in the field.


Jonas
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to