dbTalk Databases Forums  

Sorting & LOCATE vs QuickSort on UniData

comp.databases.pick comp.databases.pick


Discuss Sorting & LOCATE vs QuickSort on UniData in the comp.databases.pick forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
michael@preece.net
 
Posts: n/a

Default 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.


Reply With Quote
  #2  
Old   
michael@preece.net
 
Posts: n/a

Default Re: Sorting & LOCATE vs QuickSort on UniData - 10-03-2005 , 01:34 AM






Oops!

I lied. Took the manual as gospel. Silly. Just tested setting
udt.options 85 on. It now gives me :
-33,-22,-11,-3,-2,-1,1,2,3,4,6,11,12,13,22,33.

Mike.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.