SortArray extra flag
Posted: Wed Jun 10, 2009 2:41 pm
If there is no performance hit, would it be easy to add an extra flag to the
SortArray command, for string arrays only, that specify which character to
start sorting from? For example, consider this string array:
My dream is to be able to do this:
The last number, 4, is the new flag, and tells the array to be sorted according
to the 4th character and remaining. So if this command worked, the new array
would become this:
Why did I ask for this? Because I want to sort an array of filenames by
their name only, and not their path, but their path stops the sort from
working correctly. Currently I have to split each array (with GetFilePart)
and store their paths separately in another array, then sort and reattach
the paths to the start of the sorted names. Yucky.
(PS. RandomizeArray() for strings and numerics would be nice, too).
SortArray command, for string arrays only, that specify which character to
start sorting from? For example, consider this string array:
Code: Select all
MyArray$(1)="zzzbbb"
MyArray$(2)="yyyccc"
MyArray$(3)="xxxaaa"
Code: Select all
SortArray(MyArray(),#PB_Sort_Ascending,1,3,4)
to the 4th character and remaining. So if this command worked, the new array
would become this:
Code: Select all
MyArray$(1)="xxxaaa"
MyArray$(2)="zzzbbb"
MyArray$(3)="yyyccc"
their name only, and not their path, but their path stops the sort from
working correctly. Currently I have to split each array (with GetFilePart)
and store their paths separately in another array, then sort and reattach
the paths to the start of the sorted names. Yucky.
(PS. RandomizeArray() for strings and numerics would be nice, too).
