How do I sort an array?

I'm trying to create a MIDI related program in Snap and I need a way to sort an array (2 dimensional list)
What I want it to do is sort the first column like it's a regular list, but keep everything else in that row attached to the original item... (this is hard to explain) I'll just give an example.
Say I have this array:

___________________
| 3 |apple | red  |
| 1 |banana|yellow|
| 2 |grape | blue |
-------------------

I want to sort the rows according to the order of the first column, so it would end up like this:

___________________
| 1 |banana|yellow|
| 2 |grape | blue |
| 3 |apple | red  |
-------------------

The "sort ordering with <>" block in the List Utilities category doesn't work. Can anyone help?

The sort block is in the list utilities library

Thank you so much!! Also, I already knew it was in the List Utilities Library. I mentioned it in the original question.
:smiley:

Yeah, sorry, I didn't actually read the full post (I usually read the full post, I just didn't because I didn't have time, and someone already gave a solution).

Okay. Now how do I close a topic

You can just mark @dardoro's post as the solution. You can't close topics (they automatically close a month after the last reply)

Okay. Thanks, bye! :wink:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.