[Progress Communities] [Progress OpenEdge ABL] Forum Post: RE: Structured Error Handling

  • Thread starter Thread starter Simon L. Prinsloo
  • Start date Start date
Status
Not open for further replies.
S

Simon L. Prinsloo

Guest
To achieve that, you should put the catch block inside the child1 for each and simply leave the child1 block in oder to proceed to child to. When structured error handling was introduced, Progress had a dilemma. In a procedure file, the file itself is an implicit procedure block, so to put the catch after the block, as is traditional with C#, Java, Delphi etc. was not possible, because you cannot put it after the end-of-file, which marks the end of the implicit procedure block. The only possibility was to put the catch at the end of the file. This had a ripple effect for all other blocks. If you would put the catch after an explicit block, like a for each, and the for each is the outer most block in the procedure file, how would the compiler know if the catch applies to the procedure block of the file or to the for each? So they had to put the catch block INSIDE the block where the error needed to be trapped in all cases. The same goes for a finally. Technically, any block ends right BEFORE the first catch (or finally) in the block, so inside these blocks transactions have been rolled back (or committed), (some) locally scoped stuff are out of scope etc. You can think of it as the compiler moving the catch/finally blocks down to after the (implicit or explicit) end of the block where you coded it. But for that to work, you cannot have any code between the catch/finally blocks and the end of the block.

Continue reading...
 
Status
Not open for further replies.
Back
Top