Re: pattern for an error



TKS for ur quick and helpful answers, i think i have to reexplain my
problem

forexample my big program is perform-ing a lot of deeper layer
paragraphs, now my problem is that in one of those an error occurs,
for example the Number was not found in Database or some user imput
error ...

the case now is that at this point there is a GoTo end = finish
program
what i need is now a design pattern to handle those errors so that the
first layer paragraph knows that deep down something has gone wrong
and stops executing
for example

start.
perform prog_layer2.

do some other things
...
.

prog_layer2
perform prog_layer3
keep doing other stuff
.

prog_layer3
perform prog_layer4
now here an error occurs!!!!
.


my program looks now like that:

start.
perform prog_layer2.

do some other things
...
.

prog_layer2
perform prog_layer3
keep doing other stuff
.

prog_layer3
perform prog_layer4
now here an error occurs!!!! -> GOTO END
.


END
exit program
. (finished)





my solution i am now working at is looking like that:

start.
perform prog_layer2.
if error = 1
exit program
and dont do the other things


do some other things
...

goto end
.

prog_layer2
perform prog_layer3
if error = 1
exit program
and DONT do the other stuff below

keep doing other stuff
.

prog_layer3
perform prog_layer4
now here an error occurs!!!! ->
move 1 to error
exit program

END
exit program
. (finished)



so far i think its not that clean that solution and if those lower
layers get called often the hole thing gets VERY unclear and is full
with "if error..."
so is there any design pattern that u know for example like in java
exception handling so that i can handle my errors in a clear program
flow??

i hope now my problem is more transparent to you
and thank u all for helping me!!!

mario



.



Relevant Pages

  • Re: pattern for an error
    ... paragraphs, now my problem is that in one of those an error occurs, ... first layer paragraph knows that deep down something has gone wrong ... 3- exception handling is nothing but a GO TO, ...
    (comp.lang.cobol)
  • Re: How to move,cut & paste horizontal graphical lines too ?
    ... It sounds as though the lines are actually bottom borders belonging to the preceding paragraphs from your description. ... Much to my surprise the "normal" cut operation does NOT recognize graphical ... It seems to me that the graphical lines live on another layer which ... Is there a "cut all layers" command? ...
    (microsoft.public.office.misc)