Order Numbers

Is there anyway to order a group of numbers from smallest to highest value? I have parsed an xml based one particular filter. I would like to order the parse to numerical order. I am only dealing with 3 sets of numbers so nothing very large.
Example of return

123
789
456

I am passing these numbers into another function but the really need to be in numerical order.

There isn’t a built in sort function but there is an insertion sort example in the videoplayer sample code.

–Mark

with only 3 values, a simple bubble sort should be fine.

just add a value, then compare the second, then the third. real quick and easy.

https://www.youtube.com/watch?v=lyZQPjUT5B4&t=54s

for anyone who hasn’t seen it, here’s a fun audio/visual comparison of different sorting algorithms.

https://www.youtube.com/watch?v=kPRA0W1kECg

Oh my gosh, I was just mesmerized by that video :shock:

There is a bs sort utility here:
https://github.com/dphang/roku-lib/blob … tUtils.brs

“Komag” wrote:
Oh my gosh, I was just mesmerized by that video :shock:

I know, right? crazy interesting. Too bad they didn’t use the same number of records for each method, but then I suppose the fact that they didn’t is almost as useful for comparison sake.

Like I said, doesn’t really matter what method you use for just 3 records, but the different sort methods are interesting as heck.