#1 2014-03-28 20:33:29

martin.suer
Member
Registered: 2013-12-15
Posts: 76

TSQLRecord with Record Properties that contain Strings

Hi Arnaud,

in chapter 5.1.7 (Record Fields) of the documentation it's written:

"You may call Props.RegisterCustomRTTIRecordProperty() for a record containing reference-counted fields like string, variant or nested dynamic arrays."

Do you have an example of how to use that method?

The example with the TGUID in that chapter is working. As soon as I try to adapt that concept to a record that contains a RawUTF8 field or a dynamic array, it stops working (as expected because it's described in the documentation). But I can't figure out how to use the RegisterCustomRTTIRecordProperty method to make it work...

Martin

Offline

#2 2014-03-29 09:52:38

martin.suer
Member
Registered: 2013-12-15
Posts: 76

Re: TSQLRecord with Record Properties that contain Strings

Ok, scratch the above...

I figured it's as easy as one is used to with mORMot ;-)

Calling RegisterCustomRTTIRecordProperty like this:

Props.RegisterCustomRTTIRecordProperty(self, TypeInfo(TVOAddress), 'Address', @TSQLCustomer(nil).FAddress);

does the job.

Thanks for this great framework!

Martin

Offline

#3 2014-03-29 10:50:02

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: TSQLRecord with Record Properties that contain Strings

... just as written in the doc!
smile

Offline

Board footer

Powered by FluxBB