Page 1 of 1

IndexFieldNames issue

Posted: Thu 04 Apr 2013 10:44
by MarkF
I'm using version 8.6.12. It appears that something has changed with IndexFieldNames such that double quotes are no longer allowed in the column name. This causes a problem if the column name includes a space. Our original code looks like:

Code: Select all

      FldName := FDataSet.FieldDefs[ADataCol].DisplayName;
      FldName := AnsiQuotedStr(FldName, '"');   // No longer allowed?
      case ASortDir of
        sdAsc:  SortString := FldName + ' ASC  CIS';
        sdDesc: SortString := FldName + ' DESC CIS';
      end;
      FDataSet.IndexFieldNames := SortString;
-Mark Ford
Benthic Software

Re: IndexFieldNames issue

Posted: Thu 04 Apr 2013 11:10
by MarkF
In looking at the source code, it appears that instead of using doublequotes, we can use square brackets. This seems to work even if a field's displayname contains a space, however it fails if the field's displayname contains a square bracket. It seems like allowing double quotes as the field name delimiter in IndexFieldNames is a better choice. It would be interesting to know why this was changed.

-Mark Ford
Benthic Software

Re: IndexFieldNames issue

Posted: Thu 04 Apr 2013 14:40
by AlexP
Hello,

Thank you for the information, we have already fixed the problem with quoting, this fix will be added to next version, that will be released this month.