Tech Tip: Sorting Strings in 4D v11 SQL
PRODUCT: 4D | VERSION: 11.5 | PLATFORM: Mac & Win
Published On: January 25, 2010
4D v11 SQL compares strings differently than previous versions of 4D to better conform to standards such as Unicode and to better take into account locale specifics. 4D v11 SQL uses the open source library ICU:
https://site.icu-project.org/
For example, consider the user of the array, $text_as:
ARRAY STRING(255;$text_as;4) $text_as{1}:="A" $text_as{2}:="*" $text_as{3}:="_" $text_as{4}:="D" SORT ARRAY($text_as;>) |
Result in 4D 2004.8:
$text_as{1} is "*"
$text_as{2} is "A"
$text_as{3} is "D"
$text_as{4} is "_"
Result in 4D v11.5:
$text_as{1} is "_"
$text_as{2} is "*"
$text_as{3} is "A"
$text_as{4} is "D"