Page 1 of 1

Issues with sorting arrays using new PB 6.10 flags

Posted: Sat Feb 17, 2024 6:42 am
by marcoagpinto
Heya,

Why does:

Code: Select all

SortStructuredArray(sort_arrays_in_latin(),#PB_Sort_Ascending,OffsetOf(sort_arrays_in_latin\in_ascii.s),TypeOf(sort_arrays_in_latin\in_ascii.s))
Give different results than:

Code: Select all

SortStructuredArray(sort_arrays_in_latin(),#PB_Sort_Ascending,OffsetOf(sort_arrays_in_latin\in_ascii.s),#PB_Ascii) 
Before PB 6.10 the default was ASCII sorting, so, how come if I add that flag by force it provides different results now?

Thanks!

Re: Issues with sorting arrays using new PB 6.10 flags

Posted: Sat Feb 17, 2024 7:33 am
by Demivec
marcoagpinto wrote: Sat Feb 17, 2024 6:42 am Heya,

Why does:

Code: Select all

SortStructuredArray(sort_arrays_in_latin(),#PB_Sort_Ascending,OffsetOf(sort_arrays_in_latin\in_ascii.s),TypeOf(sort_arrays_in_latin\in_ascii.s))
Give different results than:

Code: Select all

SortStructuredArray(sort_arrays_in_latin(),#PB_Sort_Ascending,OffsetOf(sort_arrays_in_latin\in_ascii.s),#PB_Ascii) 
Before PB 6.10 the default was ASCII sorting, so, how come if I add that flag by force it provides different results now?
You did not specify the same sort types. Compare the values for the sort types:

Code: Select all

Debug TypeOf(sort_arrays_in_latin\in_ascii.s)
Debug #PB_String :The structure field to sort is a string (.s or $, fixed strings are not supported)
Debug #PB_Ascii  :The structure field to sort is an ascii character (.a)) 

Re: Issues with sorting arrays using new PB 6.10 flags

Posted: Sat Feb 17, 2024 7:44 am
by marcoagpinto
Thanks, I will make a few tests soon.

8) 8) 8) 8) 8)

Re: Issues with sorting arrays using new PB 6.10 flags

Posted: Sat Feb 17, 2024 9:09 am
by marcoagpinto
Ahhhhh...

Code: Select all

SortStructuredArray(sort_arrays_in_latin(),#PB_Sort_Ascending|#PB_Sort_NoCase,OffsetOf(sort_arrays_in_latin\in_latin.s),#PB_String)

Code: Select all

#PB_Sort_NoCase
did nothing, it still shows first words without accents and then words with accents.

Re: Issues with sorting arrays using new PB 6.10 flags

Posted: Sat Feb 17, 2024 10:06 am
by juergenkulow