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: COBOL aint quite dead - yet !
    ... The point about goto is that there is nothing at all wrong with a goto ... For example the use of an exit paragraph signals ... loops - which was all about replacing a GOTO with something that did the ...
    (comp.lang.cobol)
  • Re: COBOL aint quite dead - yet !
    ... sometimes I will replace the EXIT. ... the exactly the same label made into a comment. ... Putting in a paragraph label is a lightweight ... possibility of errors such as goto the wrong one, ...
    (comp.lang.cobol)