% \filename{addlist.tex} \version{2-jul-1995}
 
\input procsplain

\tenpt   % font size

\parindent=0pt                   % no indentation
\parfillskip=0pt               % right justify end line of paragraph
\leftskip=0pt plus 1 fil       % push additional lines to right
                               % (first line has \hfill which overrides this)

%%%%%%%%%%%%%%%%% for missing data lines:
\def\blank{}

\def\ifblankkill#1{%
        \ifx #1\blank \else #1, \fi}

\def\ifblankkillc#1{%
        \ifx #1\blank \else #1 \fi}

%%  formatted author line definition:

\long\def\address{\fullname\hskip30pt\hfill
   \ifblankkill\institution
   \ifblankkill\addone
   \ifblankkill\addtwo
   \ifblankkill\citystatezip
   \ifblankkillc\country\par}

%%%% old address, with only second address line suppressed if blank:
%\long\def\address{\fullname,\hskip30pt\hfill
% \institution, \addone, \addtwo \citystatezip, \country\par}

% interparagraph spacing to separate authors:
\def\setinterauthorspace#1{\advance\parskip by #1%
        \typeout{*** >>>> Interauthorspace set to #1.}}
\setinterauthorspace{2pt}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% tricky macros:
 
\newif\ifend
  
\def\aster{* }
\def\killast{%
   \read\addressfile to\text
      \ifx\text\aster \else\typeout{OOPS!} \fi}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% title:
\twelvept
\centerline{\bf LIST OF PARTICIPANTS}\vskip\baselineskip
\tenpt

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newread\addressfile
 
%\message{Enter name of file containing the addresses:}
%\read-1 to\addfile

\typeout{Loading the participant address list file: mg7partadd.tex}
\openin\addressfile=mg7partadd 
 
%\message{Enter name of file containing the body of the letter:}
%\read-1 to\letfile
 
%::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
%       Now read in an entry containing the person to whom to send the letter
%::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 
\endlinechar=-1
    \read\addressfile to\text \let\fullname=\text
%\read\addressfile to\text \let\lastname=\text
 
\loop
%    \read\addressfile to\text \let\fullname=\text
    \read\addressfile to\text \let\institution=\text
    \read\addressfile to\text \let\addone=\text
    \read\addressfile to\text \let\addtwo=\text  %% replaces next two lines
%    \read\addressfile to\Text
%        \ifx\Text\blank\def\addtwo{}\else\def\addtwo{\Text, }\fi
    \read\addressfile to\text \let\citystatezip=\text
    \read\addressfile to\text \let\country=\text
%        \endlinechar='015
        \endlinechar=`\^^M
    \message{Now processing address of \fullname.}
    \killast    %%%%%%%% get rid of asterisk ??

    \address    %%%%%%%% here is the single typeset address line (or two)

      \endlinechar=-1
%    \read\addressfile to\text \let\lastname=\text
    \read\addressfile to\text \let\fullname=\text
    \ifeof\addressfile\endfalse\else\endtrue\fi
    \ifend
\repeat
 
\bye



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% modification of autoletter.tex to condense 6 lines of name info to 1 line
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\input tex$amplessub:[letter]formletter.mac
\def\lineup#1 #2 #3 #4 #5 #6 {%
   \def\lastname{#1}\def\fullname{#2}\def\institution{#3}\def\addone{#4}%
   \def\addtwo{#5}\def\citystatezip{#6}%
       \ifx\addtwo\blank\def\Addtwo{}\else\def\Addtwo{\addtwo}\fi}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% use in the form: \expandafter\lineup\text
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\address#1 #2 #3 #4 #5 #6 {}%

% and for comments:
\def\comment#1{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
\message{+------------------------------------------+}
\message{| AutoLetter Version 1.1 -- 9 October 1986 |}
\message{| slightly modified by bob jantzen         |}
\message{+------------------------------------------+}
 
\newread\addressfile
 
\message{Enter name of file containing the addresses:}
\read-1 to\addfile
\openin\addressfile=\addfile
 
%\message{Enter name of file containing the body of the letter:}
%\read-1 to\letfile
 
%::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
%       Now read in an entry containing the person to whom to send the letter
%::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 
%\endlinechar=-1                                               %%mod
\read\addressfile to\text %\let\title=\text
 
\loop
                          \expandafter\lineup\text             %%mod:
%    \read\addressfile to\text \let\firstname=\text
%    \read\addressfile to\text \let\nickname=\text
%    \read\addressfile to\text \let\middlename=\text
%    \read\addressfile to\text \let\lastname=\text
%    \read\addressfile to\text
%       \ifx\text\blank\def\jr{}\else\def\jr{, \text}\fi
%        \endlinechar='015
%    \message{Now processing letter to \addressee.}
    \immediate\write-16{Now processing letter to \addressee.}
    \getaddress
    \doletter
%      \endlinechar=-1
    \read\addressfile to\text %\let\title=\text              %%mod
    \ifeof\addressfile\endfalse\else\endtrue\fi
    \ifend
\repeat
 
\bye
