Sorting an array

Fairlight fairlite at fairlite.com
Wed May 18 15:01:24 PDT 2016


On Wed, May 18, 2016 at 04:45:01PM -0400, Jose Lerebours via Filepro-list thus spoke:
> I am not even sure that filePro has methods built in to do so.

It does not.

> That being said, there is always a way to skin the cat.  A quick and
> dirty way to do this to simply dump the data into a filePro file and
> read back from that file as needed.  By doing so, you have as many
> ways to sort your array as there are indexes (provided that you have
> a multi-level array).

Dear Lord.

> If you were to install WAMP in your box, you can write PHP scripts
> which you can then call to manipulate the data and send it back in
> the order you expect by using filePro's own "user" command.  I am
> sure you could do same with Perl, Python and a ton of other
> languages by PHP is the one I prefer.

Oh, bloody hell, seriously?  Dear Lord.

While I'm the first to advocate taking certain things outside of filePro
because the language is simply not capable of doing them, there is -no-
need to invoke an entire additional architecture to accomplish something
you can do in -BASIC-.  And I'm talking regular line-number-based AppleSoft
BASIC, not that VB crud MS came up with later.

https://en.wikipedia.org/wiki/Bubble_sort

Bubble sorts are not the most elegant or best performers, but for a
20-element use case they're going to be just fine.

mark->
-- 
Audio panton, cogito singularis.


More information about the Filepro-list mailing list