# FMOD Studio::Bank:getEventList is giving me a disorder event list, how can I order it alphabetically?

**URL:** <https://qa.fmod.com/t/fmod-studio-geteventlist-is-giving-me-a-disorder-event-list-how-can-i-order-it-alphabetically/18833>\
**Category:** FMOD Engine\
**Tags:** unity\
**Created:** [June 2, 2022, 7:00pm UTC](https://qa.fmod.com/t/fmod-studio-geteventlist-is-giving-me-a-disorder-event-list-how-can-i-order-it-alphabetically/18833 "2022-06-02T19:00:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![samuelmar](https://avatars.discourse-cdn.com/v4/letter/s/ba9def/32.png) [@samuelmar](https://qa.fmod.com/u/samuelmar)\
**Post date:** [June 2, 2022, 7:00pm UTC](https://qa.fmod.com/t/fmod-studio-geteventlist-is-giving-me-a-disorder-event-list-how-can-i-order-it-alphabetically/18833/1 "2022-06-02T19:00:15Z")

</div>

I have an Unity project that has implemented FMOD audio.

When I try to retrieve an event list of a bank the events of the list are in disorder.

My code:

```auto
FMOD.Studio.Bank bank;
FMOD.Studio.EventDescription[] eventDescription;

RuntimeManager.StudioSystem.getBank("BankName", out bank);
var result = bank.getEventList(out eventDescription);

if (result == FMOD.RESULT.OK)
{
    foreach (var eventDesc in eventDescription)
    {
	eventDesc.getPath(out outString);
	Debug.Log("outString: " + outString);
    }
}

```

My debug event list’s events output  
 ![evidence1](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/5/5d1bd24dc09abc99fcc4f5431f1e86faa262d7cc.jpeg)

How my bank is set on FMOD Studio  
 ![evidence2](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/2/24c3a012b195c797ed6fdb4cc3c168def77cf8eb.jpeg)

Thanks in advance for your help!

---

<div class="post-metadata">

**Author:** ![richard\_simms](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/richard_simms/32/261_2.png) [@richard\_simms](https://qa.fmod.com/u/richard_simms)\
**Post date:** [June 3, 2022, 1:13am UTC](https://qa.fmod.com/t/fmod-studio-geteventlist-is-giving-me-a-disorder-event-list-how-can-i-order-it-alphabetically/18833/2 "2022-06-03T01:13:57Z")

</div>

The event list is ordered by the GUID of the events, not the string names. This allows users to still get the event list of a bank even if they haven’t loaded the `.strings` bank.

You will need to use `Array.Sort()` and sort the array by the event path in order to get the list to be alphabetical.

---

<div class="post-metadata">

**Author:** ![samuelmar](https://avatars.discourse-cdn.com/v4/letter/s/ba9def/32.png) [@samuelmar](https://qa.fmod.com/u/samuelmar)\
**Post date:** [June 3, 2022, 5:22am UTC](https://qa.fmod.com/t/fmod-studio-geteventlist-is-giving-me-a-disorder-event-list-how-can-i-order-it-alphabetically/18833/3 "2022-06-03T05:22:34Z")

</div>

> [@richard\_simms](#):
>
> `Array.Sort()` a

Thanks for your answer and explanation!  
Sorry but I can’t figure out how to sort using Array.Sort(), I attempting to do a solution similar at this:

```auto
string o1 = "", o2 = "";
        Array.Sort(eventDescription, (a1, a2) => String.Compare(a1.getPath(out o1), a2.getPath(out o2)));

```

But it’s indicating me an error, any ideas? Thanks in advance again!

---

<div class="post-metadata">

**Author:** ![richard\_simms](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/richard_simms/32/261_2.png) [@richard\_simms](https://qa.fmod.com/u/richard_simms)\
**Post date:** [June 3, 2022, 6:21am UTC](https://qa.fmod.com/t/fmod-studio-geteventlist-is-giving-me-a-disorder-event-list-how-can-i-order-it-alphabetically/18833/4 "2022-06-03T06:21:50Z")

</div>

`getPath` returns `FMOD.Result` so that’s why it’s returning an error.

You would need to sort it by the `out` string.

```cs
Array.Sort(descriptions, (a1, a2) => {
   a1.getPath(out o1);
   a2.getPath(out o2);
   return String.Compare(o1, o2);
});

```

---

<div class="post-metadata">

**Author:** ![samuelmar](https://avatars.discourse-cdn.com/v4/letter/s/ba9def/32.png) [@samuelmar](https://qa.fmod.com/u/samuelmar)\
**Post date:** [June 3, 2022, 4:53pm UTC](https://qa.fmod.com/t/fmod-studio-geteventlist-is-giving-me-a-disorder-event-list-how-can-i-order-it-alphabetically/18833/5 "2022-06-03T16:53:17Z")

</div>

You’re right! sorry I never have worked with out methods and they are a little confussing for me.

Thanks for all your kindly help.
