Click here to Skip to main content
15,921,276 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello, i have a small project in vb6, which detects if a process is active then exit sub. After exit sub, i have one more piece of code which must be executed. The problem comes after exit sub. The rest part of the code doesn't execute, since the process is detected and therefore exit sub.

is there any way for the code after exit sub to be executed?

What I have tried:

Cant find so far alternative for this problem.
Updated 30-Mar-23 3:10am

1 solution

No, exit sub end's the method completely at that point and returns control to the method that called it.

To do more inside the method, you should set a flag or change the way you test:
if (process exists) 
do something else
Change it to
if (not process exists) 
   do something else
do some more
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900