[fpc-pascal] Constant members within class

Christos Chryssochoidis c.chryssochoidis at gmail.com
Thu May 31 12:05:43 CEST 2007


On 5/31/07, Matt Emson <memsom at interalpha.co.uk> wrote:
>
>
> >    taclass = class
> > fi:integer;
> > public
> > property i write fi;
> >                 end;
>
> Not to pick on little details, but shouldn't that be:
>
> property i: interger read fi;
>
> as the OP wanted a read only member? What you gave them was write only.
> Maybe I misunderstood their request, if so sorry.
>
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>


Yes, I think so too, it should be

property i: interger read fi;

and furthermore fi be private (I think that the default visibility is
public...).
I 'm not sure, please correct me if  I 'm mistaken.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20070531/2db52805/attachment.html>


More information about the fpc-pascal mailing list