Monday, 22 July 2019

ClientDataSet SaveToFile writes the field values in reverse order

I have noticed that when I have a TClientDataSet with a single record and I use 'SaveToFile' to save the values to an XML files the order of the fields in the XML is in reverse order. For example if you have the following in the TClientDataSet:

TableID
Name
Address

When this is saved to an XML file the meta data is in the correct order, but the values for the fields in the XML is in reverse order.

Address
Name
TableID

I wonder if this is done by design.

The version of Delphi I am using is Tokyo.