Is there a way to exit to exit the nested procedure and the procedure of its owner?

Is there a method that can be called to exit from inside a nested procedure that will also end the owner / parent procedure?

procedure OwnerProc; procedure NestedProc; begin // Do some code here EXIT_ALL; {Call a method which will exit NestedProc and OwnerProc} end; begin NestedProc; end; 
+5
source share
1 answer

Is there a method that can be called to exit from inside a nested procedure that will also end the owner / parent procedure?

No. No.

You can create an exception and catch it in an external function. But personally, I find this pretty ugly. Perhaps cleaner is to return a boolean from the inner function, and then exit if the inner function returns False .

+10
source

Source: https://habr.com/ru/post/1240515/


All Articles