[metapost] exitif usage

Walt Burkhard burkhard at cs.ucsd.edu
Wed Feb 15 19:36:05 CET 2017


Hello,

I am using exitif within my metapost program and find many surprising output
statements.    It seems that when the exitif statement is nested within a
for statement as well as two if statements, these output messages appear.

Here is a very short program to demonstrate this behavior.

beginfig (1) ;
for a = 0 upto 10 :
  %% if ( a > 3 ) :
    if ( a < 6 ) :
      x := a*a ;
      exitif ( x > 20 )
    fi ;
  message ( decimal x ) ;
  %% fi ;
endfor ;
endfig ;

beginfig (2) ;
for a = 0 upto 10 :
  if ( a > 3 ) :
    if ( a < 6 ) :
      x := a*a ;
      exitif ( x > 20 )
    fi ;
  message ( decimal x ) ;
  fi ;
endfor ;
endfig ;
end

Here is the output along with the warning message ---

0
1
4
9
16 [1]
16 [2] )
(end occurred when if on line 22 was incomplete)
2 output files written: test.1 .. test.2

Is there a mechanism to turn off such warning messages?

Many thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/metapost/attachments/20170215/3018b036/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.mp
Type: application/octet-stream
Size: 349 bytes
Desc: not available
URL: <http://tug.org/pipermail/metapost/attachments/20170215/3018b036/attachment.obj>


More information about the metapost mailing list