# Organising functions alphabetically

**URL:** https://forum.makecode.com/t/organising-functions-alphabetically/29440
**Category:** Help
**Created:** [June 25, 2024, 7:12pm UTC](https://forum.makecode.com/t/organising-functions-alphabetically/29440 "2024-06-25T19:12:00Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![Luke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/luke/32/32519_2.png) [@Luke](https://forum.makecode.com/u/Luke)
#### Post date: [June 25, 2024, 7:12pm UTC](https://forum.makecode.com/t/organising-functions-alphabetically/29440/1 "2024-06-25T19:12:00Z")

</div>

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/8/5/85c86c905cacc81d94f4e7fbf6e448a23eb536a9.png) ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/3/7/37f262ddb3015847f93c3591750dbb68cadab0b7.png)

I was just wondering if functions were organised in any way because I have so many that it’s getting difficult to find the right ones due to the lack of alphabetical organisation  
(the ones without parameters are especially difficult to find)

---

<div class="post-metadata">

### Author: ![Sarge](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sarge/32/19590_2.png) [@Sarge](https://forum.makecode.com/u/Sarge)
#### Post date: [June 25, 2024, 9:34pm UTC](https://forum.makecode.com/t/organising-functions-alphabetically/29440/2 "2024-06-25T21:34:57Z")

</div>

I think they’re organised in order of creation(?)

---

<div class="post-metadata">

### Author: ![danger\_kitty](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/danger_kitty/32/32006_2.png) [@danger\_kitty](https://forum.makecode.com/u/danger_kitty)
#### Post date: [June 25, 2024, 9:34pm UTC](https://forum.makecode.com/t/organising-functions-alphabetically/29440/3 "2024-06-25T21:34:58Z")

</div>

Yes please @richard this would be really nice

---

<div class="post-metadata">

### Author: ![redSprite](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/redsprite/32/34262_2.png) [@redSprite](https://forum.makecode.com/u/redSprite)
#### Post date: [June 25, 2024, 9:35pm UTC](https://forum.makecode.com/t/organising-functions-alphabetically/29440/4 "2024-06-25T21:35:08Z")

</div>

I think they are organized the order you make them…  
This only applies to variables.

---

<div class="post-metadata">

### Author: ![anon30657772](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@anon30657772](https://forum.makecode.com/u/anon30657772)
#### Post date: [June 25, 2024, 9:35pm UTC](https://forum.makecode.com/t/organising-functions-alphabetically/29440/5 "2024-06-25T21:35:09Z")

</div>

So from what I know, functions are sorted by the time they’re created. Once you save and leave your game then open it again, they become sorted alphabetically!

Let me know if I’m wrong though, hopefully it works 🙏

---

<div class="post-metadata">

### Author: ![Luke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/luke/32/32519_2.png) [@Luke](https://forum.makecode.com/u/Luke)
#### Post date: [June 25, 2024, 9:55pm UTC](https://forum.makecode.com/t/organising-functions-alphabetically/29440/6 "2024-06-25T21:55:12Z")

</div>

Functions are not sorted by order of creation  
@redSprite @anon30657772

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/0/b/0ba52ab2bc604825bb2740efd7cc0663bd7b39b2.png)  
I made this function last week ^  
it’s like 16th for some reason when it should be right at the bottom  
and yes i’ve opened and closed this project several times since last week

---

<div class="post-metadata">

### Author: ![anon30657772](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@anon30657772](https://forum.makecode.com/u/anon30657772)
#### Post date: [June 25, 2024, 10:55pm UTC](https://forum.makecode.com/t/organising-functions-alphabetically/29440/7 "2024-06-25T22:55:33Z")

</div>

I meant whichever functions you create in the _ **same** _ session will be sorted by creation order.

But you’re right, after leaving and rejoining it seems the order is alphabetical but reversed and split in two?

> **Original order (by creation)**
>
> ![Original order (by creation)](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/a/3/a3ececd4285e2482c3392e12111aa4ebd6cf6041.png)3. 4.

> **New order (after leaving and coming back)**
>
> ![new order (after leaving and reopening)](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/f/9/f92c3464d7e6107e81d2fa757bc0e712843bf801.png)

Let’s hope someone else has an answer / solution to this. I’ll keep _tinkering_ in the meantime.

Edit: **I got it.**

- While in the same session, functions are sorted by creation time.
- Once you leave and return, they become sorted by alphabetical order.
- IF you had previous functions before that, it will be first sorted to groups by creation order (oldest to newest) then each group will be sorted by alphabetical order!

> **Here are some screenshots to better display it**
>
> 1. Creating functions (sorted by creation time)  
> ![Creating functions](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/9/8/98f9998415b64ac2331cc39ed4f065238b6f98b7.png)
> 2. Leaving and coming back (sorted alphabetically)  
> ![After leaving and coming back](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/8/b/8b5b10cae0a6480f5e52d9d759aae8a16b5b366d.png)
> 3. Creating more functions (old order + order of creation for newer functions)  
> ![Creating more functions](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/e/d/ed8c126cb55e13e457ec3e7014024f90983b949b.png)
> 4. Leaving and coming back again (first created functions are sorted alphabetically first THEN newer functions are sorted alphabetically separately)  
> ![After leaving and coming back again](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/a/d/ad7a7ce15902061afa773f0d085db87a9cda89f2.png)

Now this helps us understand how it’s sorted. I don’t know if there’s a way to sort them differently sadly (Besides literally re-creating each function every session).

---

<div class="post-metadata">

### Author: ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)
#### Post date: [June 26, 2024, 4:43pm UTC](https://forum.makecode.com/t/organising-functions-alphabetically/29440/8 "2024-06-26T16:43:13Z")

</div>

this behavior annoys me too. can someone create an issue for it so we track it?

---

<div class="post-metadata">

### Author: ![AlexK](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/alexk/32/33339_2.png) [@AlexK](https://forum.makecode.com/u/AlexK)
#### Post date: [June 26, 2024, 6:43pm UTC](https://forum.makecode.com/t/organising-functions-alphabetically/29440/9 "2024-06-26T18:43:31Z")

</div>

My experience is that, when you close and then reopen a project, the functions re-sort alphabetically. They just don’t do it on the fly like the **Variables** drawer does.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/0/e/0ea61ed6fcb27b6d51fdc89494316b67863d2003.png)

Regardless, feature request made. 😄

> <https://github.com/microsoft/pxt-arcade/issues/6460>
>
> \*\*Is your feature request related to a problem? Please describe.\*\*
> When creatin…g a new function, it sinks to the bottom of the \*\*Functions\*\* drawer. While helpful to find in the immediate case, it makes the drawer less useful as you add more functions.
> 
> \*\*Describe the solution you'd like\*\*
> Just as variables retain their alphabetical order, so should functions.
> 
> \*\*Describe alternatives you've considered\*\*
> It seems that closing a project and re-opening it alphabetizes the functions.
> 
> !\[image\](https://github.com/microsoft/pxt-arcade/assets/38046796/b7d11808-942c-4faf-8b26-01d5420e0c5f)

---

<div class="post-metadata">

### Author: ![Luke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/luke/32/32519_2.png) [@Luke](https://forum.makecode.com/u/Luke)
#### Post date: [June 27, 2024, 4:48pm UTC](https://forum.makecode.com/t/organising-functions-alphabetically/29440/10 "2024-06-27T16:48:15Z")

</div>

Thank you! I also like to copy existing functions and rename them so that might break the order as well
