I need to sort an array by a customized order (with symbols and underscores after letters instead of before) What is the easiest way to do that?
-John
Custom Array Sorting
Moderators: Susan Smith, admin, Gabriel
FNSNAP fnsrtary or fnsortarray
60320 DEF LIBRARY FNSRTARY(MAT L$;MAT M$,DESENDING,HEADER,FOOTER) !: ! Sorts MAT L$ in ascending order !: ! OPtionally based on MAT M$ !: ! In Descending order if DESending !: ! starting down from top to allow for a HEADER !: ! stopping before the bottom to allow for a FOOTER
or
04550 DEF LIBRARY FNSORTARRAY(MAT L$,START,LENGTH;DESENDING,HEADER,FOOTER) !: ! ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿!: ! ³ Sorts an array based on a substring within the array and ³!: ! ³ optionally omits lines at the top and bottom from the sort ³!: ! ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ!
60320 DEF LIBRARY FNSRTARY(MAT L$;MAT M$,DESENDING,HEADER,FOOTER) !: ! Sorts MAT L$ in ascending order !: ! OPtionally based on MAT M$ !: ! In Descending order if DESending !: ! starting down from top to allow for a HEADER !: ! stopping before the bottom to allow for a FOOTER
or
04550 DEF LIBRARY FNSORTARRAY(MAT L$,START,LENGTH;DESENDING,HEADER,FOOTER) !: ! ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿!: ! ³ Sorts an array based on a substring within the array and ³!: ! ³ optionally omits lines at the top and bottom from the sort ³!: ! ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ!
Will these functions allow me sort in a custom order? I don't see any parameters for that.
I checked out the documentation for them on the BR Wiki.
http://brwiki.brulescorp.com/index.php? ... _Functions
They don't look like they will fit the bill, but maybe I'm missing something.
-John
I checked out the documentation for them on the BR Wiki.
http://brwiki.brulescorp.com/index.php? ... _Functions
They don't look like they will fit the bill, but maybe I'm missing something.
-John
By "Custom order" do you mean other than ASCII hiarchy? or do you mean a subset of positions within each string?
For example do you want all item that contain an "X" regardless of where it exxists in the string to sort before "A" and after "?".
If so you would need to build a separte array that contained some key to those and reference it in FNSRTARY as array M on which array L would be sorted.
For example do you want all item that contain an "X" regardless of where it exxists in the string to sort before "A" and after "?".
If so you would need to build a separte array that contained some key to those and reference it in FNSRTARY as array M on which array L would be sorted.