Hello Hilmar,
In
Code Complete, Steve McConnell covers issues like this (and many more). If I remember correctly, the strategy you proposed is shown in his book, along with nesting, like below. He proposes a solution like yours when the number of steps makes nesting unmanageable.
I highly recommend the book...
>
>Next question. Let's say I want to follow this principle (in general, or in one specific method - doesn't matter for this question). If something goes wrong, I have to interrupt. Is there an easier way to do this than maintaining a variable, as in the following sample pseudocode?
>
local llSuccess
llContinue = .T.
(Do Something)
if (checkCondition1)
(do phase 2)
if (checkCondition2)
(do phase 3)
else
ErrorMessage("Problem 2")
llSuccess = .f.
endif
else
ErrorMessage("Problem 1")
llSuccess = .f.
endif
(Cleanup)
RETURN
Steve Gibson