distinct_fieldGenerates a list with a single field of distinct values. Syntaxlist distinct_field(list-name,col-index) list list-name expr col-index DescriptionReturns a list with a single column of distinct values.
This function sorts the source list on a specified field to group duplicate values. Distinct values in the specified field are read to a second list which is returned. ExampleChemists often save and retrieve hit lists of structures. distinct_field() can be used to make a user's hit list of distinct structure numbers. Later, this list can be opened and formatted into a SQL 'in' predicate to retrieve data on the structures.
{
list distinct_list;
distinct_list= distinct_field(wl,0);/* pass name of wl and */
/* seq of structure field*/
G.fname= filename(""); /* prompt user for filename */
if (G.fname) /* user entered fname & not cancel */
list_save(distinct_list,G.user_dir,"an");/*parms=list,path, */
/*suffix */
distinct_list=NULL;
}
Updated 19 May 1999. Copyright DataAspects Corp. 1998-1999 |