Sort (structured) Linked list via multiple fields
Posted: Tue Dec 30, 2008 10:23 am
I tried search, so sorry if this has come up before.
What I'm after is sorting of a structured linked list alphabetically (maybe one of the fields numerically too). multiple fields meaning sort by field one, then sort those that have the same field one so that they are in alphabetical order too.
Confusing explanation, so here's a demonstration:
Now, say the user wants it sorted by Album.
So we get (in title - artist - album format):
Is there a way to sort the list (in this example) by Album, then sort the Titles into alphabetical order within the albums, so we get:
Is this possible? or would it involve making extra lists to do the second sorting?
What I'm after is sorting of a structured linked list alphabetically (maybe one of the fields numerically too). multiple fields meaning sort by field one, then sort those that have the same field one so that they are in alphabetical order too.
Confusing explanation, so here's a demonstration:
Code: Select all
Structure item
title.s
artist.s
album.s
track.l
endstructure
So we get (in title - artist - album format):
You can see that the Titles are not in alphabetical order.We Will Survive (2005 Live Mix) - Warp Brothers - Skitz Mix 23
Move Your Hands Up (Radio Edit) - Club Raiders - Skitz Mix 23
Whoa - We The Kings -We The Kings
Stay Young - We The Kings -We The Kings
Is there a way to sort the list (in this example) by Album, then sort the Titles into alphabetical order within the albums, so we get:
Sorting via another combination would also be preferred, eg. artist then title.Move Your Hands Up (Radio Edit) - Club Raiders - Skitz Mix 23
We Will Survive (2005 Live Mix) - Warp Brothers - Skitz Mix 23
Stay Young - We The Kings -We The Kings
Whoa - We The Kings -We The Kings
Is this possible? or would it involve making extra lists to do the second sorting?