exitif usage

Walt Burkhard <[email protected]>
Newsgroups gmane.comp.tex.metapost
Message-ID <CAKfz9bBiawN1hH4pAq6ENvt+tQDbh4PnhWPZQr1r9pwiJ-cjQA@mail.gmail.com>
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.

--
http://tug.org/metapost/
test.mp (application/octet-stream, 349 B) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.