PDA

View Full Version : Compare variable to string returns different result in 64bit



Julie Turnpenny
8-Feb-2023, 08:38 AM
What is the best way to compare in DF20.1 64bit from existing coding of


If ((left(sText,1) > ".") Begin

where sText = "*" which returns false in 64bit but true in 'old style'

This code returns true but is this the best solution?

If (Ascii(Left(sText,1)) > Ascii(".")) Begin

Julie

Samuel Pizarro
8-Feb-2023, 09:53 AM
the problem is not related to bittiness size , but to the collating sequence that is now different on df 20.x as it's unicode !! different sort order..

you can change the collating algorithm .. setting a new global attribute DF_LOCALE_CODE.

DAW created this sample, showing all options you have to tweak the collating logic.. and in my opinion. that sample should be part of the product..

Congratulations about ICU addoption + request to not stop there! (dataaccess.com) (https://support.dataaccess.com/Forums/showthread.php?65401-Congratulations-about-ICU-addoption-request-to-not-stop-there!&highlight=DF_LOCALE_CODE)

Marcia Booth
8-Feb-2023, 11:41 AM
that sample should be part of the product..

That's a valid suggestion, Samuel. Thank you.