"phone book" or "dictionary"
If #windows collation is selected x# does a wrong "phone book" sort, while the "dictionary" sort seems to be ok. A #clipper collation seems to do a (wrong) "phone book" sort only ?
At the end of the msg the VO #windows and #clipper sort results are listed.
Code: Select all
// #DEFINE __CLIPPERSORT__
FUNCTION DoSort() AS VOID
LOCAL aSort AS ARRAY
LOCAL i AS DWORD
// Default setting is #WINDOWS
#ifdef __CLIPPERSORT__
? "#CLIPPER setting is used"
?
SetInternational( #CLIPPER)
setcollation( #clipper )
IF ! setnatdll ( "german" )
? "Error SetNatDll german"
ENDIF
SetDatecountry ( 5 ) // german
#else
? "#windows setting is used"
?
#ENDIF
? "SetInternational()" , SetInternational()
? "SetCollation()" , SetCollation()
?
aSort := { "Göthe" , "Goethe" , "Goldmann" , "Götz" , "Göbel"}
asort ( aSort )
? "------------"
? "Asort result"
? "------------"
/*
X# result: setinternational and Setcollation(#WINDOWS)
phone book (wrong) Dictionary (ok)
Göbel Göbel
Göthe <--- swap Goethe
Goethe <--- swap Goldmann
Götz Göthe
Goldmann Götz
X# result: Setinternational and SetCollation(#CLIPPER)
+ setnatdll ( "german")
( wrong, seems to do a (wrong) phone book sort only ?)
Göbel
Göthe
Goethe
Götz
Goldmann
*/
FOR i := 1 UPTO alen ( aSort )
? aSort [ i ]
NEXT
?
?
? "---------------------------"
? "List <STRING>{} sort result"
? "---------------------------"
VAR aList := List <STRING>{}
aList:add ( "Göthe" )
aList:add ( "Goethe" )
aList:add ( "Goldmann" )
aList:add ( "Götz" )
aList:add ( "Göbel" )
aList:sort()
FOREACH VAR c IN aList
? c
NEXT
RETURN
The VO results: setinternational and Setcollation(#WINDOWS)
phone book:
Göbel
Goethe
Göthe
Götz
Goldmann
dictionary:
Göbel
Goethe
Goldmann
Göthe
Götz
The VO results: Setinternational and SetCollation(#CLIPPER)
+ German.dll
Goethe
Goldmann
Göbel
Göthe
Götz
regards
Karl-Heinz