%% %% 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. %% %% You are *not* allowed to modify this file. %% %% You are *not* allowed to distribute this file. %% For distribution of the original source see %% the terms for copying and modification in the file adrlist.dtx. %% \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'.