Idea

Serge A avatar image
21 Likes"
Serge A suggested Serge A commented

Array.sort()

New Flexscript Arrays are nice, and they conveniently mimic many of the ECMAScript Array methods. One of the most important omissions is a .sort() method. It appears that the only ways to sort something in Flexscript are using a Table.sort() or implementing some sorting algorithm by hand.

I'd like to see .sort() method added to Array, with an optional function-like argument to override the comparison function. Something along the lines of

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort

flexscriptfeature request
· 3
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Serge A avatar image Serge A commented ·

Any chance to get Array.sort() in 2021?

2 Likes 2 ·
Serge A avatar image Serge A commented ·

As of FlexSim version 2018.0, Array.sort() is still not implemented.

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel commented ·

In the meantime I would use a table query over the array and return the evaluation back to an array by the clause ARRAY_AGG(..).

0 Likes 0 ·

No Comments

·

Write a Comment

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Your Opinion Counts

Share your great idea, or help out by voting for other people's ideas.