btpoole
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2015
06:30 PM
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.
Example of return
123
789
456
I am passing these numbers into another function but the really need to be in numerical order.
5 REPLIES 5

RokuMarkn
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2015
07:44 AM
Re: Order Numbers
There isn't a built in sort function but there is an insertion sort example in the videoplayer sample code.
--Mark
--Mark
BradC
Binge Watcher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2015
04:07 PM
Re: Order Numbers
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
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
♦MiniGolf♦HangMan♦Brain Puck♦Retro Tennis♦BORK♦FLIP♦Pathogen♦Pathogen 2♦Shut the Box♦Birdie♦Logic♦Dots♦Pool♦küglo♦Bubble Wrap♦Trivia Channel♦Mancala♦Air Hockey♦Weather♦CAMERA♦Your Photos Screensaver♦Desert Beauty Screensaver♦Wild Lakes Screensaver♦

Komag
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2015
07:16 PM
Re: Order Numbers
Oh my gosh, I was just mesmerized by that video :shock:

NewManLiving
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2015
08:50 PM
Re: Order Numbers
There is a bs sort utility here:
https://github.com/dphang/roku-lib/blob ... tUtils.brs
https://github.com/dphang/roku-lib/blob ... tUtils.brs
My Channels: 2D API Framework Presentation: https://owner.roku.com/add/2M9LCVC
Updated: 11-11-2015 - Completed Keyboard interface
The Joel Channel ( Final Beta )
Updated: 11-11-2015 - Completed Keyboard interface
The Joel Channel ( Final Beta )
BradC
Binge Watcher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2015
03:30 PM
Re: Order Numbers
"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.
♦MiniGolf♦HangMan♦Brain Puck♦Retro Tennis♦BORK♦FLIP♦Pathogen♦Pathogen 2♦Shut the Box♦Birdie♦Logic♦Dots♦Pool♦küglo♦Bubble Wrap♦Trivia Channel♦Mancala♦Air Hockey♦Weather♦CAMERA♦Your Photos Screensaver♦Desert Beauty Screensaver♦Wild Lakes Screensaver♦