The keys to this problem are the LOCATE and INSert UniBasic commands.
Consider a semblance of a program to do this below...
Date.Array = ''
Date.Count = dcount(These.Dates, VM) + 1
for This.Index = 1 to Date.Count
This.Date = These.Dates<This.Index>
locate This.Date in Date.Array<1> by 'AL' setting posn else
null
ins This.Date before Date.Array<posn>
next This.Index
for This.Index = 1 to Date.Count
crt This.Date
next This.Index
Remember to pay attention to syntax of AM and VM issues via...
CONVERT VM to AM in Date.Array
Regards,
--Bill
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Shawn Waldie
Sent: Friday, August 20, 2004 11:46 AM
To: [EMAIL PROTECTED]
Subject: [U2] [UD] Sorting
I have records that contains a mv list of dates, i.e.,
13200:@VM:13312:@VM:13176. I need to store these values in ascending
order, so I: a) convert the VMs to AMs, b) perform a FORMLIST,
SAVE.LIST, SORT.LIST; and c) load the values back into the attribute.
There has to be a more efficient way. Any suggestions?
TIA
************************************************
* Shawn Waldie San Juan College *
* Programmer/Analyst 4601 College Blvd *
* Phone: (505)566-3072 Farmington, NM 87402 *
* email: [EMAIL PROTECTED] *
* *
* HP-UX 11.11 UniData 6.0.4 Colleague R17 *
************************************************
-------
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/