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. 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:
*create my_array 5 5 4 3 2 1
*gosub_scene cslib_array sort "my_array"
${my_array[1]} = 1
${my_array[2]} = 2
...