Re: pattern for an error
- From: "William M. Klein" <wmklein@xxxxxxxxxxxxxxxxx>
- Date: Wed, 28 May 2008 15:03:57 GMT
If you ALWAYS want to stop the entire process once the error condition occurs
but don't want to use an EXPLICIT "GO TO". Then perform your "error routine"
where you discover the problem and at the end of the error routine use STOP RUN
and not EXIT PROGRAM.
Stay with EXIT PROGRAM (or better use GOBACK - if you can) if you want to return
to a CALLing program (but NOT to a PERFORMing section of the same program).
If you want to return to part of the same program, then you should PERFORM the
error routine and "set some flag" or other indicator that you have been in the
error routine.
I was still not clear from your explanation below exactly which of the above (or
some other logic) you want to do. If none of the above is what you are trying
to accomplish, please explain further.
It needs to be clear whether your "layers" are sections of the same program or
separate programs.
--
Bill Klein
wmklein <at> ix.netcom.com
"mario" <mmc_vw1200@xxxxxxxxxxx> wrote in message
news:5459f81a-6d4d-4c9d-b0e9-582334d0a4c9@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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
.
- References:
- pattern for an error
- From: mario
- Re: pattern for an error
- From: Howard Brazee
- Re: pattern for an error
- From: Michael Mattias
- Re: pattern for an error
- From: mario
- pattern for an error
- Prev by Date: Re: Opinions on approach, please...
- Next by Date: Re: Opinions on approach, please...
- Previous by thread: Re: pattern for an error
- Next by thread: Re: pattern for an error
- Index(es):
Relevant Pages
|