adriano.freitas
Active Member
Hi!
I have a Sub that processes Google Contacts data from an account that has thousands of records, so the loop that does the processing causes the app to "hang", generating an Android warning. If the user waits, everything works, however, the Android warning and not being able to insert an animated GIF to indicate processing, for example, make the user think there is a problem. So I created a panel that overlays the Application Screen with an animated progress gif. But even if I insert the code so that it is visible, it doesn't work because soon the loop starts and the screen doesn't get updated. My intention would be to put something like DoEvents in the middle of the loop to allow the animated gif to be displayed and move and so that the android system doesn't issue warning as if the app crashes. With DoEvents everything works perfectly, however, if I try to use Sleep(0) I need to change the sub to resumedsub. The problem is that the app is quite complex and has sub calling sub, calling sub, etc. This makes me have to change a lot of things in the code. Even so, I decided to change, however, there are several errors in the code because of unforeseen situations for the change. I solve one problem and cause several others. So I returned with DoEvents and everything worked again. I wanted to know what I can do to remove the DoEvents but not lose functionality, causing the loop not to crash the program and allow the screen to be refreshed. Any idea?
I have a Sub that processes Google Contacts data from an account that has thousands of records, so the loop that does the processing causes the app to "hang", generating an Android warning. If the user waits, everything works, however, the Android warning and not being able to insert an animated GIF to indicate processing, for example, make the user think there is a problem. So I created a panel that overlays the Application Screen with an animated progress gif. But even if I insert the code so that it is visible, it doesn't work because soon the loop starts and the screen doesn't get updated. My intention would be to put something like DoEvents in the middle of the loop to allow the animated gif to be displayed and move and so that the android system doesn't issue warning as if the app crashes. With DoEvents everything works perfectly, however, if I try to use Sleep(0) I need to change the sub to resumedsub. The problem is that the app is quite complex and has sub calling sub, calling sub, etc. This makes me have to change a lot of things in the code. Even so, I decided to change, however, there are several errors in the code because of unforeseen situations for the change. I solve one problem and cause several others. So I returned with DoEvents and everything worked again. I wanted to know what I can do to remove the DoEvents but not lose functionality, causing the loop not to crash the program and allow the screen to be refreshed. Any idea?