From bug-octave-request at bevo dot che dot wisc dot edu Fri Jan 28 15:37:06 2000 Subject: Some problems From: "John W. Eaton" To: Hagen Gilsing Cc: bug-octave at bevo dot che dot wisc dot edu Date: Fri, 28 Jan 2000 15:37:32 -0600 (CST) On 20-Feb-1999, Hagen Gilsing wrote: | octave-2.1.12:1> clear;OCTAVE_VERSION | OCTAVE_VERSION = 2.1.12 | ans = 2.1.12 | octave-2.1.12:2> counter=12 | counter = 12 | octave-2.1.12:3> while(counter>0) try x=y catch counter--;break;end_try_catch;endwhile | octave-2.1.12:4> counter | counter = 0 | octave-2.1.12:5> | | I think, the break-command in the catch-block should terminate the while-loop, i.e. | the statement | while(counter>0) try x=y catch counter--;break;end_try_catch;endwhile | should be semantically equivalent to | while(counter>0) counter--;break;endwhile | . | | octave-2.1.12:1> clear;OCTAVE_VERSION | OCTAVE_VERSION = 2.1.12 | ans = 2.1.12 | octave-2.1.12:2> counter=12 | counter = 12 | octave-2.1.12:3> while(counter>0) try error('interrupt');catch counter--;break;end_try_catch;endwhile | octave-2.1.12:4> counter | counter = 0 | octave-2.1.12:5> | | I think, theese lines demonstrate, that the problem is independent of the exception, | that causes the error. I've modified the current development sources so that Octave will behave as you expect. I think this makes sense, that a break inside a try-catch block should behave just as it would in the absence of the try-catch block, instead of just jumping to the end of the try-catch block. Thanks, jwe ----------------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.che.wisc.edu/octave/octave.html How to fund new projects: http://www.che.wisc.edu/octave/funding.html Subscription information: http://www.che.wisc.edu/octave/archive.html -----------------------------------------------------------------------