Closed markwpearce closed 3 years ago
ifArray.Sort() method does not properly sort an array of integers. Instead of sorting in ascending value, instead it sorts the values as if they were strings, so 10 comes before 9, etc.
In the BRS command line:
brs> a = [3, 2, 1, 11] brs> a.sort() brs> ?a <Component: roArray> = [ 1 11 2 3 ] brs>
But running on an actual Roku:
Brightscript Debugger> a = [3, 2, 1, 11] Brightscript Debugger> a.sort() Brightscript Debugger> ?a <Component: roArray> = [ 1 2 3 11 ] Brightscript Debugger>
ifArray.Sort() method does not properly sort an array of integers. Instead of sorting in ascending value, instead it sorts the values as if they were strings, so 10 comes before 9, etc.
In the BRS command line:
But running on an actual Roku: