This is a UniData subroutine, but should work ....
SUBROUTINE B42.SORT.ARRAY(SORTED,ARRAY)
* Bubble sort the elements of a dynamic array
* Created by: David Wademan
* Creation Date: 01/05/05
SORTED=""
VALUES = DCOUNT(ARRAY,@VM)
LOOP
CHANGES = 0
FOR X = 2 TO VALUES
* For each adjacent pair
ELEMENT1 = ARRAY<1,X-1>
ELEMENT2 = ARRAY<1,X>
IF ELEMENT2 < ELEMENT1 THEN
* Swap if pair out of sequence
ARRAY<1,X> = ELEMENT1
ARRAY<1,X-1> = ELEMENT2
CHANGES = 1
END
NEXT X
WHILE CHANGES DO REPEAT
SORTED=ARRAY
RETURN
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Baker Hughes
Sent: Tuesday, July 22, 2008 10:51 AM
To: '[email protected]'
Subject: [U2] Basic SORT() Function not avail in UniVerse?
Hey,
I'm needing to SORT a dynamic array and apparently UniVerse doesn't have
this
Function.
Other MV implementations have this, such as D3 - "The sort() function
sorts an
attribute or value mark delimited str.exp in ascending order." [from
ePick]
There was also a user exit u1072 that did the same thing.
Does anyone have a work around or fast path to same thing .... maybe I'm
missing something but can't see this in UV docs.
-Baker
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/