[fpc-devel] Error: Argument can't be assigned to

Micha Nelissen micha at neli.hopto.org
Fri May 25 11:50:20 CEST 2007


Graeme Geldenhuys wrote:
> --------- code where error occurs  ---------------
>  case Attr.Depth of
>    1: PixelFormat.FormatType := ftMono;    //  <-- line 798
>    4: PixelFormat.FormatType := ftPal4;
> public
>    property    PixelFormat: TGfxPixelFormat read FPixelFormat;

You only allow read access to a field, and you think it's strange the 
compiler doesn't allow writing ? :-).

Furthermore, using properties as reference (which includes writing to a 
field of it) is not allowed anymore. Either export a pointer, make the 
field itself public (and remove the property), or write the complete record.

Micha



More information about the fpc-devel mailing list