Hi,
maybe i got this feature wrong but look at this. I've got a listview like this :
g
a
z
f
ch
When I set the column as sortable and apply the Sort function, I get this :
a
ch
f
g
z
so it seems that RapaGUI handles "ch" as "c"...
the same goes for numbers, I've got this :
48
92
23
14
6
and after sorting I get :
14
23
48
6
92
So it really seems that RapaGUI handles only the first char of the string when sorting...
pecaN
Bug in Listview.Sort
Re: Bug in Listview.Sort
just for sure, I'm adding that in Hollywood itself sorting works correctly, so for example g,a,b,ch,v sorts as a,b,g,ch,v while RapaGUI outputs a,b,ch,g,v
- airsoftsoftwair
- Posts: 5446
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Bug in Listview.Sort
Yes, and that's correct. What else do you expect? Sorting is done alphabetically, so "ch" definitely has to come before "f", "g", and "z". Everything else wouldn't really make much sense...
Can't reproduce this here. Hollywood's Sort() function yields exactly the same results as RapaGUI, e.g.
Code: Select all
a = {"g", "a", "z", "f", "ch"}
Sort(a)
For Local k = 0 To ListItems(a) - 1 Do DebugPrint(a[k])
Code: Select all
a
ch
f
g
z
Re: Bug in Listview.Sort
OK, this is interesting!
First, sorry for such a stupid typo I made : I wrote that table {g,a,z,f,ch) is sorted as a,ch,f,g,z but that's wrong!!!
Really, when on my Win10 (Czech localization) + Hollywood 8 I use exactly the same code as you did :
a = {"g", "a", "z", "f", "ch"}
Sort(a)
For Local k = 0 To ListItems(a) - 1 Do DebugPrint(a[k])
I REALLY get it sorted as a,f,g,ch,z !!!! But it's obviously not a bug, it seems to be something with localization as I totally forgot that Czech and other Eastern European alphabets do have "ch" as STANDALONE character which is between "h" and "i" so the alphabet goes e,f,g,h,ch,i,j... etc....
So in Hollywood itself this works perfectly for us Easterns but when I use this characters as items in a listview column (RapaGUI 1.2) :
g
a
z
f
ch
and then I sort it, I get as you write
a
ch
f
g
z
So i was just curious why Hollywood and RapaGUI sort it in a different way, both use UTF-8 encoding, maybe it's because of different font?
but I can live with it, that's just a curse of being an Eastern European so it can be solved quite easily
BUT!! there's still the problem with sorting numbers in RapaGUI as I wrote!!
when I have a table of numbers in Hollywood table={48, 2, 23, 14, 6} it gets sorted right = 2,6,14,23,48
BUT when I have these numbers as listview items in RapaGUI :
48
2
23
14
6
and I sort the column I get this :
14
2
23
48
6
which clearly is wrong....
Sorry for such a long post but sorting a listview is a VITAL feature for listview..... pecaN
First, sorry for such a stupid typo I made : I wrote that table {g,a,z,f,ch) is sorted as a,ch,f,g,z but that's wrong!!!
Really, when on my Win10 (Czech localization) + Hollywood 8 I use exactly the same code as you did :
a = {"g", "a", "z", "f", "ch"}
Sort(a)
For Local k = 0 To ListItems(a) - 1 Do DebugPrint(a[k])
I REALLY get it sorted as a,f,g,ch,z !!!! But it's obviously not a bug, it seems to be something with localization as I totally forgot that Czech and other Eastern European alphabets do have "ch" as STANDALONE character which is between "h" and "i" so the alphabet goes e,f,g,h,ch,i,j... etc....
So in Hollywood itself this works perfectly for us Easterns but when I use this characters as items in a listview column (RapaGUI 1.2) :
g
a
z
f
ch
and then I sort it, I get as you write
a
ch
f
g
z
So i was just curious why Hollywood and RapaGUI sort it in a different way, both use UTF-8 encoding, maybe it's because of different font?
but I can live with it, that's just a curse of being an Eastern European so it can be solved quite easily
BUT!! there's still the problem with sorting numbers in RapaGUI as I wrote!!
when I have a table of numbers in Hollywood table={48, 2, 23, 14, 6} it gets sorted right = 2,6,14,23,48
BUT when I have these numbers as listview items in RapaGUI :
48
2
23
14
6
and I sort the column I get this :
14
2
23
48
6
which clearly is wrong....
Sorry for such a long post but sorting a listview is a VITAL feature for listview..... pecaN
- airsoftsoftwair
- Posts: 5446
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Bug in Listview.Sort
No, that's clearly a bug in RapaGUI. Will be fixed...So i was just curious why Hollywood and RapaGUI sort it in a different way, both use UTF-8 encoding, maybe it's because of different font?
No, it's not. When using strings, Hollywood will always sort alphabetically, e.g.BUT!! there's still the problem with sorting numbers in RapaGUI as I wrote!!
when I have a table of numbers in Hollywood table={48, 2, 23, 14, 6} it gets sorted right = 2,6,14,23,48
BUT when I have these numbers as listview items in RapaGUI :
48
2
23
14
6
and I sort the column I get this :
14
2
23
48
6
which clearly is wrong....
Code: Select all
table={48, 2, 23, 14, 6} ; table contains numbers = numerical sort
Sort(table) ; will result in 2,6,14,23,48
table={"48", "2", "23", "14", "6"} ; table contains strings = alphabetical sort
Sort(table) ; will result in "14", "2", "23", "48", "6"
- airsoftsoftwair
- Posts: 5446
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Bug in Listview.Sort
Code: Select all
- Fix [Windows/macOS/Linux]: Listview sorting didn't always work correctly for non-ISO-8859-1 languages
Re: Bug in Listview.Sort
Wow, great again, thanks! Btw, this means that the fix will be applied in the next RapaGUI version? pecaN