%  string library for TeX
%
%  Andrew Marc Greene
%
\newcount\STRCMPVAL
\newcount\STRCMPTMP
\let\ea\expandafter
%
\def\HRULE{\hrule}
\def\strcmp#1#2{\STRCMP.#1\hrule\relax.#2\hrule\relax}
\def\STRCMP#1#2\relax#3#4\relax{%
\STRCMPVAL`#1 \STRCMPTMP`#3 
%\message{\number\STRCMPVAL/\number\STRCMPTMP}
\advance\STRCMPVAL by -\STRCMPTMP
\ifnum\STRCMPVAL=0
\let\next\STRCMP
\def\TMP{#2}\ifx\TMP\HRULE\STRCMPVAL=1  \let\next\STRCMPEND\fi
\def\TMP{#4}\ifx\TMP\HRULE\STRCMPVAL=-1 \let\next\STRCMPEND\fi
\else\let\next\STRCMPEND 
\fi\next#2\relax#4\relax}
\def\STRCMPEND#1\relax#2\relax{}
%
%\strcmp{ABCDE}{ABCQW}
%\message{\number\STRCMPVAL}
%\strcmp{ABCDE}{ABCDE}
%\message{\number\STRCMPVAL}
%\strcmp{ABCDE}{ABC}
%\message{\number\STRCMPVAL}
%\strcmp{ABC}{ABCDE}
%\message{\number\STRCMPVAL}
