Try using TimeStamp::literalFormat().I tried this just now which is almost perfect although it breaks on timestamps, as it sorts them as a string value and 01/01/2012 is lower then 10/01/1999I'd go with 7 String keys on the ExtKeyDynaDict, and then if they've only chosen 3 of 7 sort options, set the remaining key values to a null string as you don't care about the sort ordering from that point onwards.
Then, when you're deciding what to use for each of the 7 string key parameters to the putAtKey, you can "generate" a string key from the underlying data in a format that will sort correctly regardless of the type of data that is actually in that column.
Cheers,
BeeJay.
That's what I meant byI tried this just now which is almost perfect although it breaks on timestamps, as it sorts them as a string value and 01/01/2012 is lower then 10/01/1999
For TimeStamps, and other similarly affected values, I don't just type-cast to a String but rather use a formatted string that will sort correctly.you can "generate" a string key from the underlying data in a format that will sort correctly
Code: Select all
theKey := someTS.String;
dynaDict.putAtKey( theKey, someObject );
theKey := someTS.Date.format("yyyyMMdd") & " " & someTS.Time.format("HH:mm:ss");
dynaDict.putAtKey( theKey, someObject );
// The following only works if you've defined a Short Date format and Short Time format called ShortDateSortingFormat and ShortTimeSortingFormat respectively:
theKey := someTS.Date.userFormat($ShortDateSortingFormat) & " " & someTS.Time.userFormat($ShortTimeSortingFormat);
dynaDict.putAtKey( theKey, someObject );
Return to “General Discussion”
Users browsing this forum: No registered users and 5 guests