D Dey Active Member Licensed User Longtime User Jul 4, 2018 #1 B4A V8.30 I attach demo program press TEST button and watch log then insert a break point in Sub Execute es. at line 36 or 39 re-run TEST it can be noted that pause_status value is not correct You can verify ? Without brack point it seems to work correctly Thank you sorry for the english translated with google Attachments TestWaitFor.zip TestWaitFor.zip 9.7 KB · Views: 242
B4A V8.30 I attach demo program press TEST button and watch log then insert a break point in Sub Execute es. at line 36 or 39 re-run TEST it can be noted that pause_status value is not correct You can verify ? Without brack point it seems to work correctly Thank you sorry for the english translated with google
Erel B4X founder Staff member Licensed User Longtime User Jul 5, 2018 #2 There is indeed an issue here. Will check it. Upvote 0
D Dey Active Member Licensed User Longtime User Jul 5, 2018 #3 Erel said: There is indeed an issue here. Will check it. Click to expand... Hi Erel Do you think we can solve the problem quickly? I use the waitfor function a lot thank you Upvote 0
Erel said: There is indeed an issue here. Will check it. Click to expand... Hi Erel Do you think we can solve the problem quickly? I use the waitfor function a lot thank you
Erel B4X founder Staff member Licensed User Longtime User Jul 5, 2018 #4 The issue here will only happen in very specific cases. There are also better way to design this code. You can use CallSub with a sub that returns a ResumableSub. Exactly like you do with local subs. This way you will not need to poll a global variable. Upvote 0
The issue here will only happen in very specific cases. There are also better way to design this code. You can use CallSub with a sub that returns a ResumableSub. Exactly like you do with local subs. This way you will not need to poll a global variable.
D Dey Active Member Licensed User Longtime User Jul 5, 2018 #5 Erel said: The issue here will only happen in very specific cases. There are also better way to design this code. You can use CallSub with a sub that returns a ResumableSub. Exactly like you do with local subs. This way you will not need to poll a global variable. Click to expand... my problem is working on servers there can be operations that take a few seconds and users in this case put the device in standby when I wake up I need to understand where I arrived Please give me an example to improve the code? thanks for your time Upvote 0
Erel said: The issue here will only happen in very specific cases. There are also better way to design this code. You can use CallSub with a sub that returns a ResumableSub. Exactly like you do with local subs. This way you will not need to poll a global variable. Click to expand... my problem is working on servers there can be operations that take a few seconds and users in this case put the device in standby when I wake up I need to understand where I arrived Please give me an example to improve the code? thanks for your time
Erel B4X founder Staff member Licensed User Longtime User Jul 5, 2018 #6 Your current code will not work if the activity is paused. You should move whatever you can to the starter server and only use the activity to update the UI. The exact code depends on your requirements. I recommend you to watch this tutorial: The general pattern is: - Do everything in a service. Starter service is a good place. - Store the relevant state in process_global variables. - Call an "Update State" sub in the activity whenever the state changes. - Call this sub from Activity_Resume. This way the activity will always show the latest state. Upvote 0
Your current code will not work if the activity is paused. You should move whatever you can to the starter server and only use the activity to update the UI. The exact code depends on your requirements. I recommend you to watch this tutorial: The general pattern is: - Do everything in a service. Starter service is a good place. - Store the relevant state in process_global variables. - Call an "Update State" sub in the activity whenever the state changes. - Call this sub from Activity_Resume. This way the activity will always show the latest state.
Erel B4X founder Staff member Licensed User Longtime User Dec 4, 2018 #7 Issue is fixed for the next update. Upvote 0