Path: utzoo!utgpu!water!watmath!clyde!rutgers!cmcl2!husc6!bbn!uwmcsd1!ig!jade!ucbvax!ARIZONA.EDU!gudeman From: gudeman@ARIZONA.EDU ("David Gudeman") Newsgroups: comp.lang.icon Subject: complicated sorts Message-ID: <8801140005.AA18177@megaron.arizona.edu> Date: 14 Jan 88 00:05:33 GMT References: <8801132040.AA07880@megaron.arizona.edu> Sender: daemon@ucbvax.BERKELEY.EDU Distribution: inet Organization: The ARPA Internet Lines: 17 From: ihnp4!ihuxy!nowlin ...How could I pass a list of sorting keys that consist of strings corresponding to the labels used to reference the fields in a record instead of numeric indexes for the record that is being sorted to the recsort() procedure? If you didn't follow that question here is an example of what I mean. Given the program that follows, If I want to sort the password file by the uid field I have to invoke the program with "3" as the sorting key. I'd like to be able to invoke it with "uid" as the sorting key. You can't reference records by string name anyway, so getting a string corresponding to a field name wouldn't do you any good. You probably should be using tables if you want to do this. Table references are a little uglier than record references, e.g.: foo["name"] vs. foo.name, but tables are a lot more flexible.