Hi guys,
Yeah, the demo is kinda viral. I used the code directly from the QB4.5 installation which happens to be exactly the same code as in your .EDU link, JJ. So, since there's no better (meaning more personal) attribution, I've now added your link to the file header. It won't go into any distros since it probably still might be under MS' protection but there's no reason why it shouldn't be quoted on open forums if it's available on academic sites: (thnx Jochen!)
//============================================================================
// QB4.5 to FBSL v3.5 RC3 port (c)2016 Mike Lobanovsky
//============================================================================
' ============================================================================
' http://galileo.phys.virginia.edu/classes/551.jvn.fall01/SORTS.BAS
' ============================================================================
' SORTDEMO
' This program graphically demonstrates six common sorting algorithms. It
' prints 25 or 43 horizontal bars, all of different lengths and all in random
' order, then sorts the bars from smallest to longest.
........
QuickSort (or QwickSort to avoid a naming conflict with FBSL's built-in function of the same name) should've been at least as fast as ExchangeSort but procedure returns in FBSL BASIC are points of unconditional garbage collection, so the four recursive calls within Qwick are definitely taking their toll.
As for
[00565][SORTDEMO.fbs] Error &H64: called object isn't a function
that's because you're evidently using an older RC3 build that didn't support InKey() (line 565 in the original script), nor blocking WaitKey(), nor Wait(), and that's exactly why I supplied a precompiled executable in my OP. Get the newer RC3 build from the 7-zip below -- it will run the script by dragging and dropping perfectly. I'm currently revising the FBSL BASIC console vocab to substitute its functions' rigid sets of parameters with more flexible optional ones.