Do you BREAK()?

Before showing the porting to the accountant lady, I absolutely need to complete the port of the most important executable, the one used all day long for all the data input.

The situation is the following:

276 function starts
340 BEGIN SEQUENCE
602 RETURN
1096   BEGIN SEQUENCE // nested
1215   END SEQUENCE   // nested
1568 END SEQUENCE
1590 function ends

Several BREAKs are present in different lines of the file.

As in other cases also in this one the SEQUENCE is used for unconditional jump. This is a more complex situation than the previous ones but not too different: I will use the same solution I used to solve error 8 in the previous post. I will convert the RETURN to BREAK 2 and all BREAKs from line 341 to 1095 and from line 1216 to 1567 to BREAK 1. I will then add a RECOVER USING before line 1568 to handle the two cases.

Is it enough? Probably. But there is one possibility that I still don’t handle: BREAK can be used by a function called in the 2 blocks of code listed above! I browsed the code and I didn’t find any external function calls, so my changes should be safe. If a BREAK is somewhere deeper in the code, the RECOVER will fail with an unitialized variable since it’s passed value is NIL.

Now also this executable compiles.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>