[zl sort] case sensitivity
[zl sort] seems to output list items beginning with an upper case character before those beginning with a lower case letter, or at least it does for me. For example:
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 119 55 48 196617 loadbang;
#P newex 119 122 126 196617 print notquitealphabetised;
#P message 119 76 153 196617 zebra Zebra aardvark Aardvark;
#P newex 119 99 40 196617 zl sort;
#P connect 3 0 1 0;
#P connect 0 0 2 0;
#P connect 1 0 0 0;
#P window clipboard copycount 4;
I had a quick look in the help file, manual and on the list and couldn’t find any reference to this behaviour (although doubtless I’m missing something obvious): is it to be expected, and can it be changed?
On Mar 29, 2008, at 9:40 AM, Daniel Fordham wrote:
> [zl sort] seems to output list items beginning with an upper case
> character before those beginning with a lower case letter, or at
> least it does for me.
A quick perusal of an ASCII chart will show you that upper case
letters come before lower case letters. http://en.wikipedia.org/wiki/Ascii
Because zl really doesn’t care too much about what, exactly, it’s
sorting using strict numeric sort.
Sounds like simple ASCII-sorting. Take a look at an ASCII table and it should be obvious what’s going on. May not be what you want, but it’s common in the digital world to do things like that.
If you want case-agnostic sorting, you’ll need to put in a feature request. Or find a 3rd party object that does it. Take a look at Peter Elsea’s LObjects. I don’t know if there’s anything there, but it’s the obvious place to look.
Thanks both; I’ll investigate the LObjects.