From 638e976c38349874d6c28087ed1dbd9fa1d25d1f Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 12 Jan 2006 23:51:07 +0000 Subject: adrlist git-svn-id: svn://tug.org/texlive/trunk@648 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/adrlist/adrlist.sty | 128 ++++++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 Master/texmf-dist/tex/latex/adrlist/adrlist.sty diff --git a/Master/texmf-dist/tex/latex/adrlist/adrlist.sty b/Master/texmf-dist/tex/latex/adrlist/adrlist.sty new file mode 100644 index 00000000000..7f92324e5c5 --- /dev/null +++ b/Master/texmf-dist/tex/latex/adrlist/adrlist.sty @@ -0,0 +1,128 @@ +%% +%% 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'. -- cgit v1.2.3