Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.
Sort Array AR2 error (I think)
Using 2.0.2.RC12
PART_LIST=SRP_Array("SortRows",PART_LIST,"AR2"
The order is not correct using the values in field 2.
They are all numeric, but different lengths, some with dec points.
Screen show shows before and after.
The before screen shot is actually in order in this case, but this is not guaranteed so I run it through the sort to be sure.
PART_LIST=SRP_Array("SortRows",PART_LIST,"AR2"
The order is not correct using the values in field 2.
They are all numeric, but different lengths, some with dec points.
Screen show shows before and after.
The before screen shot is actually in order in this case, but this is not guaranteed so I run it through the sort to be sure.
Comments
Loads of things failing now.
That being said, I realize some of our documentation uses the terms "numerical" when describing the sorting process, so I accept responsibility to setting up false expectations. As a mea culpa, I will update the sorting algorithms to treat N as a true numerical sort and R as a traditional right sort (for backward compatibility with V119). The sort will be slower since it will have to convert each value it sorts into a true decimal number while sorting and back to a string again.
I think as long as its documented and made clear then we can deal with it internally.
It does mean a pre-process before any sort to ensure that all values are formatted with leading and trailing zeros.
Having said that the N sort would be great , as it means no pre-processing.
Eg, a V119 Right justified sort on these strings (comma delimted)
a15.8 a-20y a15.3 a-15.8f a20 a-15.3 a-1.8 a-1.3x a0 a1.3 a1.8
will result asa-20y a-15.8f a-15.3 a-1.8 a-1.3x a0 a1.3 a1.8 a15.3 a15.8 a20
(Kevin - see our email discussions ~ July 8, 2010)
Cheers, M@
Might not always be right, as the - character might be a delimiter of a field rather than a minus sign.
I think any sorts that require this type of content needs to be addressed by the code.