#1 2012-11-10 09:41:23

array81
Member
From: Italy
Registered: 2010-07-23
Posts: 411

FieldsName properties not found

On my application I use this code:

          for b := 0 to Length(ContactsRecords.RecordProps.FieldsName) - 1 do
            begin
              var1 := StringReplace(var1, '[' + ContactsRecords.RecordProps.FieldsName[b] + ']', UTF8ToString(ContactsRecords.GetFieldValue(ContactsRecords.RecordProps.FieldsName[b])), [rfReplaceAll, rfIgnoreCase]);
              var2 := StringReplace(var2, '[' + ContactsRecords.RecordProps.FieldsName[b] + ']', UTF8ToString(ContactsRecords.GetFieldValue(ContactsRecords.RecordProps.FieldsName[b])), [rfReplaceAll, rfIgnoreCase]);
              var3 := StringReplace(var3, '[' + ContactsRecords.RecordProps.FieldsName[b] + ']', UTF8ToString(ContactsRecords.GetFieldValue(ContactsRecords.RecordProps.FieldsName[b])), [rfReplaceAll, rfIgnoreCase]);
            end;

On last version of your framework TSQLRecordProperties.FieldsName is remove, why?
How can I replace my code?

Offline

#2 2012-11-13 14:40:43

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

Re: FieldsName properties not found

Due to huge code refactoring of the RTTI handling in mORMot core, TSQLPropInfoList has been introduced: it is an unique entry point for all fields definitions.
It is much more convenient and expandable than the previous implementation.

So you can use ContactsRecords.RecordProps.Fields.Count / ContactsRecords.RecordProps.Fields[] instead of ContactsRecords.RecordProps.FieldsName[].

Offline

Board footer

Powered by FluxBB