rtek1000 Active Member Licensed User Longtime User Nov 28, 2021 #1 I saw a recommendation not to use DoEvents: DoEvents should be avoided in all platforms. Use CallSubDelayed if you want to run something after the current sub finishes. Click to expand... Source: https://www.b4x.com/android/forum/threads/doevents-alternative.68918/#post-437288 But the window freezes if you don't use something to wait a while. And Windows O.S. notifies you that the window is not responding. I managed to read thousands of lines in a text file without freezes the window like this: - I use a CallSubDelayed - Inside the long loop I use a Sleep(0) command I don't know if there's a better way to do this, but it worked here. If you don't use the Sleep(0) command, the window continues to freeze. I'm converting a text file of tens of thousands of lines into an Excel spreadsheet. Is there a more efficient way than using Sleep(0)? Thank you.
I saw a recommendation not to use DoEvents: DoEvents should be avoided in all platforms. Use CallSubDelayed if you want to run something after the current sub finishes. Click to expand... Source: https://www.b4x.com/android/forum/threads/doevents-alternative.68918/#post-437288 But the window freezes if you don't use something to wait a while. And Windows O.S. notifies you that the window is not responding. I managed to read thousands of lines in a text file without freezes the window like this: - I use a CallSubDelayed - Inside the long loop I use a Sleep(0) command I don't know if there's a better way to do this, but it worked here. If you don't use the Sleep(0) command, the window continues to freeze. I'm converting a text file of tens of thousands of lines into an Excel spreadsheet. Is there a more efficient way than using Sleep(0)? Thank you.
rtek1000 Active Member Licensed User Longtime User Nov 29, 2021 #21 Erel said: BTW, the progress bar won't show anything without a call to Sleep. Better to remove it. Click to expand... Remove progress bar? The progress bar works normally here, without using Sleep. Upvote 0
Erel said: BTW, the progress bar won't show anything without a call to Sleep. Better to remove it. Click to expand... Remove progress bar? The progress bar works normally here, without using Sleep.