Sorting the results of a Cross Reference Index Search (OpenInsight Specific)
At 07 MAR 2000 03:06:08PM Rick Todd wrote:
I've figured out how to use the INDEXLOOKUP function in a script. Now I would like to be able to sort the result list prior to display it in a popup. Does anyone have any suggestions? Thanks Rick
DECLARE FUNCTION INDEXLOOKUP, MAKE.LIST, POPUP
DECLARE SUBROUTINE SET_PROPERTY, SEND_EVENT
S_WINDOW=CLIENT_PERSONAL"
S_FILE=CLIENT"
S_INDEX=ADDRESS_XREF"
S_POPUP=CLIENT"
S_COLUMN=CLIENT_NUMBER":@VM:"SOCIAL_SECURITY":@VM:"LAST_NAME":@VM:
"JUNIOR_SENIOR":@VM:"FIRST_NAME":@VM:"MIDDLE_NAME":@VM:"AGE"
S_KEYS=IndexLookup(S_WINDOW,S_FILE,S_INDEX,S_COLUMN,"SINGLE","")
* Sort the records (S_KEYS) by FULL_NAME of the client file
* Display the sorted information in a popup
At 07 MAR 2000 04:25PM DSig wrote:
Rick,
A simple process would be to make your list a 'active' list then use RLIST.
Declare Subroutine Make.List
Declare Subroutine Rlist
$Insert Rlist_Equates
then after you have received a list .. convert @vm to @fm in keys make.list(0,keys,"","") Rlist("SELECT tablename BY FULL_NAME",Target_ActiveList$,"","","") * at this point you have an active select list of ids .. then simply do the popup and if it is set to use active list .. POW
You could also look at the use of 'reduce' which works similary BUT I use rlist as it *seems* more user friendly
DSig
At 07 MAR 2000 04:45PM Don Bakke wrote:
Rick,
If I understand your situation correctly, you can take your return list of keys, create an active select list out of them, use RList to select against this list sorted by FULL_NAME and then call PopUp. For example:
S_KEYS=IndexLookup(S_WINDOW,S_FILE,S_INDEX,S_COLUMN,"SINGLE","")
Covert @VM to @FM in S_KEYS
/* Make an active select list */
Make.List(0, S_KEYS, "", "")
/* Make a new active select list sorted by FULL_NAME */
RList("SELECT CLIENT BY FULL_NAME", 5, "", "", "")
/* Now call a PopUp designed to select rows from table */
Keys=PopUp(@Window, "", "CLIENT")
dbakke@srpcs.com