|
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
|
01-28-2007 13:57
Okay, here's an interesting little problem. How can you sort a list so that 'a' comes before 'Z'? So far, I've appended an llToUpper of the first character of each list element to itself... llListSort'ed and then removed the appended first character from each list element. Which is both kludgy and imperfect. Can anyone come up with a better strategy? I'm trying to alphabetically sort player names returned from the sensor Event - in case that helps or hinders. Oh, and the final list needs to preserve it's original case. 
|
|
Arachnid Baxter
Registered User
Join date: 8 Jan 2007
Posts: 44
|
01-28-2007 14:10
From: Pale Spectre Okay, here's an interesting little problem. How can you sort a list so that 'a' comes before 'Z'? So far, I've appended an llToUpper of the first character of each list element to itself... llListSort'ed and then removed the appended first character from each list element. Which is both kludgy and imperfect. Can anyone come up with a better strategy? I'm trying to alphabetically sort player names returned from the sensor Event - in case that helps or hinders. Oh, and the final list needs to preserve it's original case.  A couple of options: - Compose a list of alternating lower cased and original avatar names, then sort with a stride of 2. Discard every second element to get elements in original capitalisation, sorted case insensitively. - Write your own list sort algorithm. 
|
|
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
|
01-28-2007 14:39
From: Arachnid Baxter Compose a list of alternating lower cased and original avatar names, then sort with a stride of 2. Discard every second element to get elements in original capitalisation, sorted case insensitively. Heh... I like that, thanks. I think llList2ListStrided should make the extraction of the final list pretty painless too. Cheers. 
|