.fin
.all
     A list consists of a series of names, words, numbers, or groupings of
items.  List processing involves placing the items (data records) in a list in
order, and sorting, adding, discarding or selecting items from the list.  List
processing uses three types of files:  a listin file, a lister file, and a
listform file.

     The listin file is used to enter and update a list with a text editor.
It contains a header that defines the parts of the records as they appear in
the listin file, and it contains the individual records that make up the list.
For example, the following are two records in a doctor's list of patients:
.fif

Record_delimiter: $;
Field_delimiter: =;
Field_names: lname,fname,street,city,state,zip
Records:
$
=lname Doe
=fname John
=street 17 Oak St.
=city Boston
=state Massachusetts
=zip 12112
$
=lname Smith
=fname Jane
=street 898 Linden Way
=city Cambridge
=state Massachusetts
=zip 02139
.fin

The record delimiter separates records from each other, and the field
delimiter marks the beginning of a field name.  The listin file must have a
name that ends with the suffix '.listin'.

     A lister file contains a list in a form that can be processed.  Once
you've constructed a listin file, you convert it to a lister file with the
create_list command.  This command takes the name of the new lister file as its
"pathname" "argument".  For example:

create_list patients.lister

The command creates the lister file from the listin file with the same name.
The only difference between the names is the final suffixes--'.listin' and
'.lister'.

     In order to process a list, you need a listform file to specify how the
list will appear when printed.  As an example, let's assume the doctor wants
an organized list of her patients and their addresses.  She would use a text
editor to construct a listform file like the following:
.fif

<Begin before:>
         Patient Addresses
<end;>
<Begin record:> <fname> <lname>
<street>
<city>, <state>   <zip>
<end;>
<Begin after:>
         Medical Associates
<end;>
.fin

The 'before' and 'after' sections contain information that will appear only
once with the entire list, not with each record.  A list form does not have to
contain all the fields in the records of a lister file to be usable with that
file.  In fact, a single lister file can be processed with different listform
files to produce a variety of formats for the records.

     Lister files are processed with the process_list command.  This command
takes two pathname arguments, one for the lister file and one for the
listform.  For example:

process_list patients.lister addresses.listform

The suffixes '.lister' and '.listform' must be on the names of the respective
files, but they need not be supplied on the command line as they are in this
example.

     There are three important "control arguments" that are often needed with
the process_list command: -select, -sort, and -output_file.  The -select
control argument enables you to select certain records for processing.  It
consists of three parts: the field name, a comparison operator, and a test
string.  The comparison operator specifies what comparison is to be performed.
The operators are: 'contains,' 'not contains,' 'equal,' 'not equal,' 'greater,'
'not greater,' 'less,' and 'not less.' The test string is the value to which
the field name is compared.  For example, to list all the patients whose last
names begin with 'S', type:

process_list patients addresses -select "lname equal S"

     The -sort control argument is used to change the order in which the list
is processed.  For example, if you type:

process_list patients addresses -sort lname

the records in patients.lister will be processed in alphabetical order by last
name.

     Finally, the -output_file control argument is used to place the processed
list into a "segment" which can then be printed out on some form of printer.
For example, if you were putting the names in patients.lister into the format
of a letter, then you would probably want to print the results out on
letterhead in a high-quality wordprocessing printer.  To do that you would
first have to store the processed information in a segment.

     There are other useful list processing procedures documented in the Guide
to Multics WORDPRO for New Users (Order No. DJ18) and the Multics WORDPRO
Reference Guide (AZ98).
