It gives you a greater degree of control compared to some languages. I'm not aware that many other languages have a sort thats particularly more sophisticated in reality its probably doing the same just 'under the covers' as theyre higher level than objectscript. The alternative is to pass the data out to whatever front end you're using and have it sort prior to displaying but then most likely its the client doing that work rather than your server.
We've previously passed the data into new indices to utilise the auto sorting nature of the objectscript arrays, using a number based or alphabetical index depending on how we're hoping to organise the data.
eg. s NewData(Data(Key,"Name")) = Data(Key)
With object classes or mapped globals we tend to use the sql queries to sort the data as required lately.
There are the json and dynamic arrays that can be used for collection / array data storage.
We use both depending on the situation. VS Code is more modern and certainly better for Git and Merge tools than Studio but it doesn't have all the abilities of Studio that I've found, global storage properties etc. We've found VS Code doesn't handle physical files as well as Studio at least for InterSystems so its unfriendly when using CSPs that are version controlled.
Log in or create a new account to continue