To continue with this content, please log in with your Data Access ID or create a new account.
Cancel Data Access ID
You may not be authorized to see this content. Please contact Data Access Europe for more information.
Cancel Data Access Europe
You are not authorized to see this content.
Cancel Data Access Europe
Next lesson:
PART 3 Settings for building and running 64 bit
Cancel

Migrating to DataFlex 2021 Part 2

Lesson 11: Collation

This lesson we  will look at sorting and comparing string data from the database, otherwise known as collation. Character data is sorted and compared using rules that define the correct character sequence, with options for specifying case-sensitivity, accent marks, etcetera.String comparisons with Unicode are much more complicated than with OEM or ANSI. DataFlex 2021 uses the ICU Library for comparing strings according to the Unicode standards. ICU is a cross-platform Unicode based globalization library. Multiple collations are supported and can be configured via the new DF_LOCALE_CODE string attribute. This global attribute defaults to the language of the operating system and can be changed at runtime. This website for the available locale codes: http://userguide.icu-project.org/collation/customization 

Note that when using the embedded database, the indexes will be built up according to the old collating system configured via DF_Collate.cfg for backwards compatibility.


Demonstration

  • This sample application will demonstrate collation. On the left-hand side, strings can be entered, and on the right they will be sorted using the locale code.
  • Selecting the F7 key will show the code, and shows that in the sorting routine, the DF_LOCALE_CODE attribute is set.
  • If the application is run and the sort button selected, the information is sorted according to the default Locale Code on the machine.
  • There are all kinds of settings available to influence the collation, and this is what the ICU library is capable of. Just to show, if Numeric is turned on, then the sorting of three items is changed, because three is smaller than 12 and 12 is smaller than 110.
  • If Numeric is turned off again, and if the Japanese collation rules are used, then the sorting order of these Japanese symbols are changed.


Conclusion

This is the end of part 2 of this course on Migrating to DataFlex 2021. In this part you have learned what Unicode is and how you can convert your software to support Unicode. In the next part, I will go into detail about 64-bit. The next part will be online later this year!