Bug? wait for on debug

Dey

Active Member
Licensed User
Longtime User
Hello to all
This attached example does not work in debugging
try in released
and debugged
Thank you
 

Attachments

  • Test2WaitFor.zip
    9.8 KB · Views: 171

Erel

B4X founder
Staff member
Licensed User
Longtime User
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.
 

Mahares

Expert
Licensed User
Longtime User
This attached example does not work in debugging
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
    9.7 KB · Views: 157
Top