1 .fin
  2 .all
  3      A list consists of a series of names, words, numbers, or groupings of
  4 items.  List processing involves placing the items (data records) in a list in
  5 order, and sorting, adding, discarding or selecting items from the list.  List
  6 processing uses three types of files:  a listin file, a lister file, and a
  7 listform file.
  8 
  9      The listin file is used to enter and update a list with a text editor.
 10 It contains a header that defines the parts of the records as they appear in
 11 the listin file, and it contains the individual records that make up the list.
 12 For example, the following are two records in a doctor's list of patients:
 13 .fif
 14 
 15 Record_delimiter: $;
 16 Field_delimiter: =;
 17 Field_names: lname,fname,street,city,state,zip
 18 Records:
 19 $
 20 =lname Doe
 21 =fname John
 22 =street 17 Oak St.
 23 =city Boston
 24 =state Massachusetts
 25 =zip 12112
 26 $
 27 =lname Smith
 28 =fname Jane
 29 =street 898 Linden Way
 30 =city Cambridge
 31 =state Massachusetts
 32 =zip 02139
 33 .fin
 34 
 35 The record delimiter separates records from each other, and the field
 36 delimiter marks the beginning of a field name.  The listin file must have a
 37 name that ends with the suffix '.listin'.
 38 
 39      A lister file contains a list in a form that can be processed.  Once
 40 you've constructed a listin file, you convert it to a lister file with the
 41 create_list command.  This command takes the name of the new lister file as its
 42 "pathname" "argument".  For example:
 43 
 44 create_list patients.lister
 45 
 46 The command creates the lister file from the listin file with the same name.
 47 The only difference between the names is the final suffixes--'.listin' and
 48 '.lister'.
 49 
 50      In order to process a list, you need a listform file to specify how the
 51 list will appear when printed.  As an example, let's assume the doctor wants
 52 an organized list of her patients and their addresses.  She would use a text
 53 editor to construct a listform file like the following:
 54 .fif
 55 
 56 <Begin before:>
 57          Patient Addresses
 58 <end;>
 59 <Begin record:> <fname> <lname>
 60 <street>
 61 <city>, <state>   <zip>
 62 <end;>
 63 <Begin after:>
 64          Medical Associates
 65 <end;>
 66 .fin
 67 
 68 The 'before' and 'after' sections contain information that will appear only
 69 once with the entire list, not with each record.  A list form does not have to
 70 contain all the fields in the records of a lister file to be usable with that
 71 file.  In fact, a single lister file can be processed with different listform
 72 files to produce a variety of formats for the records.
 73 
 74      Lister files are processed with the process_list command.  This command
 75 takes two pathname arguments, one for the lister file and one for the
 76 listform.  For example:
 77 
 78 process_list patients.lister addresses.listform
 79 
 80 The suffixes '.lister' and '.listform' must be on the names of the respective
 81 files, but they need not be supplied on the command line as they are in this
 82 example.
 83 
 84      There are three important "control arguments" that are often needed with
 85 the process_list command: -select, -sort, and -output_file.  The -select
 86 control argument enables you to select certain records for processing.  It
 87 consists of three parts: the field name, a comparison operator, and a test
 88 string.  The comparison operator specifies what comparison is to be performed.
 89 The operators are: 'contains,' 'not contains,' 'equal,' 'not equal,' 'greater,'
 90 'not greater,' 'less,' and 'not less.' The test string is the value to which
 91 the field name is compared.  For example, to list all the patients whose last
 92 names begin with 'S', type:
 93 
 94 process_list patients addresses -select "lname equal S"
 95 
 96      The -sort control argument is used to change the order in which the list
 97 is processed.  For example, if you type:
 98 
 99 process_list patients addresses -sort lname
100 
101 the records in patients.lister will be processed in alphabetical order by last
102 name.
103 
104      Finally, the -output_file control argument is used to place the processed
105 list into a "segment" which can then be printed out on some form of printer.
106 For example, if you were putting the names in patients.lister into the format
107 of a letter, then you would probably want to print the results out on
108 letterhead in a high-quality wordprocessing printer.  To do that you would
109 first have to store the processed information in a segment.
110 
111      There are other useful list processing procedures documented in the Guide
112 to Multics WORDPRO for New Users (Order No. DJ18) and the Multics WORDPRO
113 Reference Guide (AZ98).