0

BrightScript: How to sort an roList alphabetically? (from ListDir)

Hi. I was surprised to see that the results of ListDir aren't alphabetical by default and there doesn't seem to be an argument for sort criteria. It seems like the order is defined by the filesystem, perhaps in the order that files were added to the disk?

I want my script to play all files from a folder in alphabetical order, so I guess I need to sort the results of ListDir. But how? I don't see any methods that would work with arrays full of strings, but I'm not experienced enough to be sure. There are posts on the Roku forum that suggest a sort method was introduced for those devices in 2016 but I don't think that applies to BrightSigns? https://sdkdocs.roku.com/display/sdkdoc/ifArraySort

Any help would be appreciated. Thanks!

1 comment

Please sign in to leave a comment.