[texhax] Strange \loop-behaviour
Philip and Le Khanh
Philip-and-LeKhanh at Royal-Tunbridge-Wells.Org
Tue Jun 2 09:35:34 CEST 2009
The problem lies in the incomplete assignment
to \more; better would be the following --
\ifeof 1\more = 0\relax \fi
Philip TAYLOR
--------
Reiner Durchholz wrote:
> This is a report of what I believe is a flaw in the "\loop" implementation.
> The appended source text behaves differently with and without the
> \null-command.
> Instead of \null, almost any other command can be used.
> The flaw came to my attention when I first used a \showthe for error
> analysis.
>
> The used system is OS X 10.5.5.
> The TeX system is TeXShop V2.26 with XeTeXk, Version
> 3.1415926-2.2-0.999.6 (Web2C 7.5.7)
>
> %!TEX TS-program = xetex
> %!TEX encoding = UTF-8 Unicode
> \parindent=0cm
> % ______________________________________________________
> \openin1=TestObject
> \newcount\more \more=1 % used as boolean, set to "true"
> % -----------------------------------------
> \loop
> \read 1 to \InputLine
> \ifeof1\more=0\fi
> \null % without this command, the loop either does not end or ends
> immediately
> \number\more
> \ifnum\more=1
> -- \InputLine\ +++ \hfil\break
> \repeat
> % -----------------------------------------
> \closein1
> \bye
>
>
>
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -- -- -- --
> -- -- - -- -- -- -- -- -- --
> Dr. Reiner Durchholz
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -- -- -- --
> -- -- - -- -- -- -- -- -- --
>
>
>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> TeX FAQ: http://www.tex.ac.uk/faq
> Mailing list archives: http://tug.org/pipermail/texhax/
> More links: http://tug.org/begin.html
>
> Automated subscription management: http://tug.org/mailman/listinfo/texhax
> Human mailing list managers: postmaster at tug.org
More information about the texhax
mailing list