There are exactly two ways to do what you want:
- Return an error/status code and have every function on the call stack check that code.
- Raise an exception and handle it at the high level.
You do not wish to use option 1, so that leaves option 2.
문제
In Delphi, I have a hierarchy of routines. Routine 'A' calls 'B' which calls 'C' which calls 'D'. 'D' does some checking, and it encounters an error of some type, maybe an Exception,maybe just a logical error. Regardless, when 'D' encounters the error, is there anyway for control to pass back to 'A' without having 'D' return a 'failure' code, which 'C' checks for, which returns a failure code, which 'B' checks for, etc...?
Thanks
GS
해결책
There are exactly two ways to do what you want:
You do not wish to use option 1, so that leaves option 2.