[texhax] Strange \loop-behaviour
Reiner Durchholz
r.durchholz at online.de
Mon Jun 1 20:37:05 CEST 2009
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
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -- -- --
-- -- -- - -- -- -- -- -- -- --
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/texhax/attachments/20090601/9480e078/attachment.html>
More information about the texhax
mailing list