[metapost] Problem with readfrom

Reinhard Kotucha reinhard.kotucha at web.de
Mon Jun 14 03:20:56 CEST 2010


On 14 June 2010 Karel wrote:

 > Christophe Poulain napsal(a):
 > > hi,
 > > 
 > > i've used the following code
 > > 
 > > beginfig(1);
 > > string toto;
 > > toto="datas/"&"fichier.dat"
 > > numeric num;
 > > num=scantokens readfrom toto;
 > > endfig;
 > > 
 > > (fichier.dat is a file with numeric numbers, one per line)
 > > 
 > > but, with metapost 1.203, it doesn't compile and with metapost 0.993,
 > > it compile.
 > > With metapost 1.203,
 > > 	num=scantokens readfrom "datas/fichier.dat"
 > > works.
 > > 
 > > Where is the problem ?
 > > 
 > 
 > The line
 > toto="datas/"&"fichier.dat"
 > should end with ;

But

  toto="datas/"&"fichier.dat"
  numeric num;

without the semicolon produces a completely misleading error message:

! Extra tokens will be flushed.
<to be read again> 
                   numeric
l.4 numeric
            num;
? 

Isn't it possible to provide a more reasonable error message?

Regards,
  Reinhard

-- 
----------------------------------------------------------------------------
Reinhard Kotucha			              Phone: +49-511-3373112
Marschnerstr. 25
D-30167 Hannover	                      mailto:reinhard.kotucha at web.de
----------------------------------------------------------------------------
Microsoft isn't the answer. Microsoft is the question, and the answer is NO.
----------------------------------------------------------------------------


More information about the metapost mailing list