%%
%% This is file `adrlist.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% adrlist.dtx 
%% 
%% IMPORTANT NOTICE:
%% 
%% For the copyright see the source file.
%% 
%% Any modified versions of this file must be renamed
%% with new filenames distinct from adrlist.sty.
%% 
%% For distribution of the original source see the terms
%% for copying and modification in the file adrlist.dtx.
%% 
%% This generated file may be distributed as long as the
%% original source files, as listed above, are part of the
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
\ProvidesPackage{adrlist}[1995/12/21]
\RequirePackage{ifthen}
\newboolean{AddressLoop}
\newboolean{Rest}\setboolean{Rest}{true}
\newcounter{Communication}
\newcommand{\ifstringcompare}[4]{%
  \begingroup
    \let\protect=\noexpand
    \edef\0{#1}\edef\1{#2}%
  \expandafter\endgroup\ifx\0\1#3\else#4\fi}
\newcommand{\concat}[2]{#1\\#2}
\def\keyword#1:#2|{#1}
\def\contents#1:#2|{#2}
\newcommand{\ForEachAddress}[2]
{
 \newread\File \openin\File=#1
 \whiledo{\boolean{Rest}}
 { \ReadNextAddress{\File}
   \ifthenelse{\boolean{Rest}}{#2}{}
 }
 \closein\File
}
\newcommand{\ReadNextAddress}[1]{
 \ifthenelse{\boolean{Rest}}{
   \read#1 to \Title
   \ifeof#1\setboolean{Rest}{false}
   \else % If last address already is read, EOF should appear here
     \ifthenelse{\boolean{Rest}}
                {\read#1 to \Opening
                 \ifeof#1\setboolean{Rest}{false}\fi
                }{}
     \ifthenelse{\boolean{Rest}}
                {\read#1 to \Sex
                 \ifeof#1\setboolean{Rest}{false}\fi
                }{}
     \ifthenelse{\boolean{Rest}}
                {\read#1 to \Firstname
                 \ifeof#1\setboolean{Rest}{false}\fi
                }{}
     \ifthenelse{\boolean{Rest}}
                {\read#1 to \Name
                 \ifeof#1\setboolean{Rest}{false}\fi
                }{}
     \ifthenelse{\boolean{Rest}}
                {\read#1 to \Dummy
                 \ifeof#1\setboolean{Rest}{false}\fi
                }{}
     \setboolean{AddressLoop}{true}
     \def\Emptystring{} \let\Address=\Emptystring
     \def\Delimiter{-- end address -- }
     \whiledo{\boolean{AddressLoop}}
     {
       \ifRest \read#1 to \Buffer \fi
       \ifeof#1\setboolean{Rest}{false}\fi
       \ifstringcompare{\Buffer}{\Delimiter}
                       {\setboolean{AddressLoop}{false}}{}
       \ifthenelse{\boolean{AddressLoop}}
       {
         \ifstringcompare{\Emptystring}{\Address}
         {
           \let\Address=\Buffer % Don't add delimiters the first time
         }
         {
            \begingroup     % keep redefinition of \\ local
            \let\protect=\noexpand
            \def\\{\noexpand\\}% make \\ not expandable
           \edef\x{\endgroup
            \def\noexpand\Address{\concat\Address\Buffer}%
           }\x
         }
       }{}
    }
    \def\KeyWTelephone{Telephone}
    \def\KeyWTelefax{Telefax}
    \def\KeyWEMail{EMail}
    \setcounter{Communication}{0}
    \whiledo{\value{Communication}<4}%
    {
      \ifthenelse{\boolean{Rest}}{
        \read#1 to \Buffer
        \edef\KeyW{\expandafter\keyword\Buffer|}
        \ifstringcompare{\KeyW}{\KeyWTelephone}
        {
          \edef\Telephone{\expandafter\contents\Buffer|}
        }
        {
          \ifstringcompare{\KeyW}{\KeyWTelefax}
          {
            \edef\Telefax{\expandafter\contents\Buffer|}
          }
          {
            \ifstringcompare{\KeyW}{\KeyWEMail}
            {
              \edef\EMail{\expandafter\contents\Buffer|}
            }
            {
              \edef\PrivateNumber{\expandafter\contents\Buffer|}
            }
          }
        }
        \ifeof#1\setboolean{Rest}{false}\fi
      }{}
      \stepcounter{Communication}
   }
   \fi
 }{}
}
\endinput
%%
%% End of file `adrlist.sty'.
