I am confused by the SORT, but I am guessing that something like this would
work:
LIST = ""
(some selection criteria)
LOOP
WHILE READNEXT KEY
LOCATE KEY IN LIST<1> BY "AL" SETTING POS ELSE
INS KEY BEFORE LIST<POS>
END
REPEAT
This builds you list and sorts it all at once.
Based on the flavor you are running, you might need to replace:
LIST<1> with just LIST
If you can build your select in a "SELECT" command, you could replace the
LOCATE logic with a simple:
LIST<-1> = KEY
John Israel
Sr. Programmer/Analyst
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Greg Schraiber
Sent: Tuesday, February 03, 2009 11:30 AM
To: [email protected]
Subject: [U2] unibasic's sort function
I have a dynamic array built like this:
LIST = ""
KEY = CONDES.DESIGNATION : "*" : CONTRIB.DONOR.DATE : "*" : ID.NO
IF LEN(LIST) = 0 THEN
LIST = KEY
END ELSE
LIST := @AM : KEY
END
When I do:
LIST = SORT(LIST) in Unibasic, compil and run it, it returns LIST=0
Can anyone tell me what I am doing wrong?
Thanks for your help!
Greg Schraiber
Beloit College
-------
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/