[fpc-pascal] Better usage of "with"

Sven Barth pascaldragon at googlemail.com
Thu Jun 14 17:23:39 CEST 2018


Ryan Joseph <ryan at thealchemistguild.com> schrieb am Do., 14. Juni 2018,
14:48:

>
>
> > On Jun 14, 2018, at 7:26 PM, Sven Barth via fpc-pascal <
> fpc-pascal at lists.freepascal.org> wrote:
> >
> > Because one needs to be able to represent the properties in the RTTI.
> Without pointers all that is needed to access the property from code is an
> offset. With pointers you'd need to add where dereferences are required
> especially as the "path" to the final field could be more complex (e.g.
> Field1^.Field3.Field1.Field5^.FinalField).
>
> I guess I don’t understand because I thought an offset to a pointer you
> dereference is as good as an offset to anything else. The property contains
> the ^ symbol so it should know to dereference the pointer at the offset
> right?
>

The RTTI for a property contains *only* the offset to the final field
inside the record, object or class instance. With a dereference in between
this does not work anymore as the field could now be anywhere.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20180614/f9740889/attachment.html>


More information about the fpc-pascal mailing list