11-11-2024, 06:36 AM
(translated by Google translator)
Hello, Yumda.
At the very end of the subroutine, I insert some necessary line of code or an empty operation, like this: "x = x".
Before this line I insert a transition label, for example: "subName_Exit:".
Now I can jump to the end of the subroutine from anywhere in the code to exit it.
' ---
Sub Test
... ' any code
Goto subTest_Exit
... ' any code
subTest_Exit:
x = x
EndSub
' ----
Hello, Yumda.

At the very end of the subroutine, I insert some necessary line of code or an empty operation, like this: "x = x".
Before this line I insert a transition label, for example: "subName_Exit:".
Now I can jump to the end of the subroutine from anywhere in the code to exit it.
' ---
Sub Test
... ' any code
Goto subTest_Exit
... ' any code
subTest_Exit:
x = x
EndSub
' ----