Sorting & LOCATE vs QuickSort on UniData -
10-03-2005
, 12:49 AM
Hi
During my attempts to compare performance using different sorting
techniques I have stumbled across an unforeseen difficulty...
If I have a list : -33,-22,-11,-3,-2,-1,1,2,3,4,6,11,12,13,22,33
and sort it using LOCATE...BY "AR"... I get:
1,2,3,4,6,-1,-2,-3,11,12,13,22,33,-11,-22,-33
(I wonder just how often that capability has proved valuable.)
I can set Udt.Options 85, in which case I get:
-1,-11,-2,-22,-3,-33,1,11,12,13,2,22,3,33,4,6
(Again, probably not what anyone would likely need or want.)
So - there seems to be no way I can compare a sort using UniBasic's
LOCATE against a sort using a subroutine call to QuickSort (and get the
same sorted list). I can't make QuickSort's greater-than or less-than
comparison mimic the LOCATE...BY..."AR" can I? The ">" or "<"
comparison will treat the variables as numeric (in which case the sign
will be treated correctly - that is to say: not the same way as the
LOCATE...BY..."AR") or as string (as if BY..."AL" had been used).
D3 has the "ARS" expression and UniVerse has "DN". Do the other
flavours all have the capability to properly LOCATE signed numerics -
or is UniData not the odd one out after all?
Mike. |