Check when a sub end

rossati

Active Member
Licensed User
Longtime User
Hello

I would check if a sub in an activity is ended i.e. from module or class module I call (callsubdelayed ) a sub in an activity module; i need to know when this sub is exited.

Thanks

John Rossati
 

TomA

Active Member
Licensed User
Longtime User
I would think this could be done fairly simply with a flag.

Under Process_Globals, create a flag
Dim MyFlag as boolean

In the routine where the call is made:
MyFlag = false
CallSubDelayed(.....

In the sub being called:
.
.
.
MyFlag = true ' Last line of code in the sub
End Sub

In the place where you are waiting for the call to be completed:

Do While MyFlag = false
Loop

I am not sure, but I would expect this or something like it would work.
 
Upvote 0

rossati

Active Member
Licensed User
Longtime User
Check when a sub ends

Tahnks TomA

Your answer is correct, but I discarded, because (I apoligize, I have forgotted to write this), I would'nt interfere with the called sub, i.e. the sub called should only deal with data provided from the class module.

John Rossati
 
Upvote 0

rossati

Active Member
Licensed User
Longtime User
Check when a sub ends

Hello

In effect I need a synchronous CallSubDelayed, which can return a value.

John Rossati
 
Upvote 0
Top