D dimartinoentertainment Member Licensed User Longtime User Dec 4, 2012 #1 Hi there Is there a way to cancel 'running' subs when using CallSubDelayed? I did some research but I couldn't find a solution for it. Thanks in advance!
Hi there Is there a way to cancel 'running' subs when using CallSubDelayed? I did some research but I couldn't find a solution for it. Thanks in advance!
mc73 Well-Known Member Licensed User Longtime User Dec 4, 2012 #2 the first thing that comes in my mind is to declare a process global variable, name it 'okRun' and when wr need the sub to not run, we set this variable to true. inside the sub we check this variable and if true, we return without executing the remaining code. unfortunately this will not prevent the corresponding activity from starting up. Upvote 0
the first thing that comes in my mind is to declare a process global variable, name it 'okRun' and when wr need the sub to not run, we set this variable to true. inside the sub we check this variable and if true, we return without executing the remaining code. unfortunately this will not prevent the corresponding activity from starting up.
Erel B4X founder Staff member Licensed User Longtime User Dec 4, 2012 #3 Why will you want to cancel the call? You should instead avoid calling it from the beginning. Upvote 0
D dimartinoentertainment Member Licensed User Longtime User Dec 4, 2012 #4 That's indeed a good idea, mc73! But yes, it doesn't prevent the activity from showing up, but still thanks. Upvote 0
That's indeed a good idea, mc73! But yes, it doesn't prevent the activity from showing up, but still thanks.
D dimartinoentertainment Member Licensed User Longtime User Dec 4, 2012 #5 Erel said: Why will you want to cancel the call? You should instead avoid calling it from the beginning. Click to expand... I'm trying to achieve some type of threading with different activities. And because CallSubDelayed is a pretty useful and advanced function, I used it instead of creating it by myself. Upvote 0
Erel said: Why will you want to cancel the call? You should instead avoid calling it from the beginning. Click to expand... I'm trying to achieve some type of threading with different activities. And because CallSubDelayed is a pretty useful and advanced function, I used it instead of creating it by myself.
mc73 Well-Known Member Licensed User Longtime User Dec 4, 2012 #6 dimartinoentertainment said: I'm trying to achieve some type of threading with different activities. And because CallSubDelayed is a pretty useful and advanced function, I used it instead of creating it by myself. Click to expand... You can even use this variable and check it inside the activity_create of the other activity. If 'true' finish the activity Upvote 0
dimartinoentertainment said: I'm trying to achieve some type of threading with different activities. And because CallSubDelayed is a pretty useful and advanced function, I used it instead of creating it by myself. Click to expand... You can even use this variable and check it inside the activity_create of the other activity. If 'true' finish the activity
D dimartinoentertainment Member Licensed User Longtime User Dec 4, 2012 #7 mc73 said: You can even use this variable and check it inside the activity_create of the other activity. If 'true' finish the activity Click to expand... I could try that out. But when I call Activity.Finish inside activity_create, will it still call activity_resume after that ? Upvote 0
mc73 said: You can even use this variable and check it inside the activity_create of the other activity. If 'true' finish the activity Click to expand... I could try that out. But when I call Activity.Finish inside activity_create, will it still call activity_resume after that ?