# 🧰 \[TOOL\] CSLIB - ChoiceScript Library

**URL:** <https://forum.choiceofgames.com/t/tool-cslib-choicescript-library/100950>\
**Category:** Game Development\
**Tags:** tips, coder\
**Created:** [May 21, 2021, 10:44pm UTC](https://forum.choiceofgames.com/t/tool-cslib-choicescript-library/100950 "2021-05-21T22:44:16Z")\
**Posts on this page:** 1\
**Showing post:** 21

<div class="post-metadata">

**Author:** ![CJW](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/cjw/32/111787_2.png) [@CJW](https://forum.choiceofgames.com/u/CJW)\
**Post date:** [November 3, 2024, 5:40pm UTC](https://forum.choiceofgames.com/t/tool-cslib-choicescript-library/100950/21 "2024-11-03T17:40:10Z")

</div>

You’re very welcome. I’ve stuck a draft of a “sort” method for arrays up on the CSLIB repository: [Add sort method to cslib\_array by CareyJWilliams · Pull Request #51 · ChoicescriptIDE/cslib · GitHub](https://github.com/ChoicescriptIDE/cslib/pull/51). Any feedback would be welcome.

You can try it out by:

- copying and pasting the new code added to `cslib_array` into your own project
- Making sure you have a global var called `cslib_ret` (as CSLIB always requires)

And then:

```choicescript
*create my_array 5 5 4 3 2 1
*gosub_scene cslib_array sort "my_array"
${my_array[1]} = 1
${my_array[2]} = 2
...

```

---

_[View the full topic](https://forum.choiceofgames.com/t/tool-cslib-choicescript-library/100950)._
