Call sub AFTER the current sub is done

Drstein99

Junior Contributor
Joined
Sep 26, 2003
Messages
283
Location
Audubon, Nj
I'm writing a program that has to follow a certain path (at times).

The program always needs to respond to its usual events.

The times when it must follow a path, I want to execute the next function, which may mean it might execute another function etc ....

I'm wondering: Is there a way to instruct the event handler to execute a subroutine AFTER the current subroutine is finished?
 
you could call the next sub ( depending on a boolean value ) from the current sub, eg:
Visual Basic:
Private Sub SomeSub(ByVal Text As String,ByVal BlValue As Boolean)
'/// carry out the Sub
If BlValue Then
    Call SomeOtherSub() '/// any value needed for the next sub in brackets.
Else
    '/// do something else.
End If
 
Yes I understand I can call other subroutines from WITHIN the sub.

My program will call the subs and then that sub may call another sub which may call the same original sub back again. I was wondering if it may cause a problem stacking all these subs on top of each other. If that WAS an issue, I wanted to see if there was a way to tell the command structure to call the sub AFTER the current one was done.
 
if all of your code is broken out into subs and functions then it should not matter how and when you call them. the issue is just the jump-off point, the event that the user triggers, and based on that, call your subs in whatever order is appropriate for what the user did.
 
Back
Top