Issues with sorting arrays using new PB 6.10 flags

Just starting out? Need help? Post your questions and find answers here.
User avatar
marcoagpinto
Addict
Addict
Posts: 1076
Joined: Sun Mar 10, 2013 3:01 pm
Location: Portugal
Contact:

Issues with sorting arrays using new PB 6.10 flags

Post 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!
User avatar
Demivec
Addict
Addict
Posts: 4281
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: Issues with sorting arrays using new PB 6.10 flags

Post 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)) 
User avatar
marcoagpinto
Addict
Addict
Posts: 1076
Joined: Sun Mar 10, 2013 3:01 pm
Location: Portugal
Contact:

Re: Issues with sorting arrays using new PB 6.10 flags

Post by marcoagpinto »

Thanks, I will make a few tests soon.

8) 8) 8) 8) 8)
User avatar
marcoagpinto
Addict
Addict
Posts: 1076
Joined: Sun Mar 10, 2013 3:01 pm
Location: Portugal
Contact:

Re: Issues with sorting arrays using new PB 6.10 flags

Post 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.
Post Reply