pattern for an error



hi everyone,
i have to redesign a peace of code with a lot of GOTOs
looks like that

start.
perform something
perform something_else
perform anything
perform anything_else
...
.

something.
do_something
if (x>10)
error occurs
go to error
end-if
do_something_else
if (y=z)
error occurs
go to error
end-if
.

error.
write error msg
.
ende.
exit program.


so as u maybe see in any paragraph there are exit conditions when the
program should stop and write error massage
my problem now: is there any style guide or pattern to make that in a
clean way WITHOUT goto because i have to transfair it into an acu code
without goto.
the only way i´m thinking is to give a intern retern key after any
paragraph but code would look very confusing right??

kind regards
.



Relevant Pages

  • Re: pattern for an error
    ... so as u maybe see in any paragraph there are exit conditions when the ... clean way WITHOUT goto because i have to transfair it into an acu code ... Change 'go to error' into 'perform error' (where error includes exit program), ...
    (comp.lang.cobol)
  • Re: Returning text from Userdefined Functions
    ... the paragraph that I named "End:" is in my original program ... I have also tried not to use the line "Goto Slutt" in my error handler ... Because the error handler is called from the UDF it is subject to the same ... aren't notified and simply get the VALUE error in the cell. ...
    (microsoft.public.excel.programming)
  • Re: Spaghetti code (was: Is it always possible to write a COBOL program using only 1 sentence per
    ... > the GOTO would be spaghetti-coding. ... was written in the spaghetti style of coding was to ask: ... I can infer what the performed paragraph does ... number that is within epsilon of the true positive square root (i.e. the ...
    (comp.lang.cobol)
  • Re: Spaghetti code (was: Is it always possible to write a COBOL program using only 1 sentence per pa
    ... The only mechanism allowed is 'perform paragraph'. ... > It isn't that the GOTO is a bad statement, but if it exists it destroys ... It is possible to write a standards checker that reads code before it gets ... approved for production - that would limit how a label can be reached. ...
    (comp.lang.cobol)
  • Re: Perform Thru/Go to vs. Perform - Compile Speed
    ... r> is to cater for additional paragraph labels in the scope of the ... r> a GO TO between labels within the scope (or worse to branch back into ... paragraph called "ANFANG", ... by simple fall thru, by a GOTO, by a PERFORM and what have you. ...
    (comp.lang.cobol)