Android Question Sleep(0) vs DoEvents (again)

Mickster

Active Member
Licensed User
Longtime User
Existing threads always say not to post but to start a new thread...seems a bit odd because one can end-up having to read multiple threads that cover a single issue

Anyway, I am pretty much a B4A newbie again after 10 years and really excited to be working with this awesome B4X ???

We developed an app more than 10 years ago and it has been running constantly, in many locations, controlling industrial machinery.

Originally, we didn't anticipate an issue with higher screen resolutions coming along but now I have to tackle this issue and it's going well.

In the original code, there are quite a few DoEvents. Reading the latest documentation, it is recommended to replace these with Sleep(0) but if I do this, I get all kinds of complaints:


I accept the fact that the code is probably at fault but does it matter if I decide to stick with the deprecated DoEvents, as in, will it bite me down the road?

Regards,

Craig
 
Last edited:

agraham

Expert
Licensed User
Longtime User
will it bite me down the road
Probably. See this post of mine
You will likely have to adapt your code to use WaitFors.
 
Upvote 0

Mickster

Active Member
Licensed User
Longtime User
How should we help here?

Well the code has been in constant use, around the world since 2012 but it doesn't like having DoEvents replaced by Sleep(0)
and so my above question was:
but does it matter if I decide to stick with the deprecated DoEvents, as in, will it bite me down the road?
 
Upvote 0

Mickster

Active Member
Licensed User
Longtime User
Cool....I shall investigate. Many thanks ?
 
Upvote 0

Mickster

Active Member
Licensed User
Longtime User
If in doubt, leave it out ?
Got rid of all of them and the app works perfectly ?

Regards,

Craig
 
Upvote 0

MicroDrie

Well-Known Member
Licensed User
Longtime User
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…