D Dey Active Member Licensed User Longtime User Jul 5, 2018 #1 Hello to all This attached example does not work in debugging try in released and debugged Thank you Attachments Test2WaitFor.zip Test2WaitFor.zip 9.8 KB · Views: 356
Erel B4X founder Staff member Licensed User Longtime User Jul 5, 2018 #2 Your code is wrong. You should never use CallSub to raise an event that is intercepted with Wait For. Use CallSubDelayed instead. Otherwise there is a chance that the event will be raised before the wait for line was reached. Anyway, your approach here is wrong and will likely to cause all kinds of problems. You should instead wait for subs that return ResumableSubs. Including in the first call that is done from the activity.
Your code is wrong. You should never use CallSub to raise an event that is intercepted with Wait For. Use CallSubDelayed instead. Otherwise there is a chance that the event will be raised before the wait for line was reached. Anyway, your approach here is wrong and will likely to cause all kinds of problems. You should instead wait for subs that return ResumableSubs. Including in the first call that is done from the activity.
M Mahares Expert Licensed User Longtime User Jul 5, 2018 #3 Dey said: This attached example does not work in debugging Click to expand... I made the changes to your code in your above project that were suggested by @Erel and it seems to work for me in debug and release modes. I hope this is the result you are trying to achieve. See attached project: Attachments WaitForInDebugMahares.zip WaitForInDebugMahares.zip 9.7 KB · Views: 339
Dey said: This attached example does not work in debugging Click to expand... I made the changes to your code in your above project that were suggested by @Erel and it seems to work for me in debug and release modes. I hope this is the result you are trying to achieve. See attached project: