BarryW Active Member Licensed User Longtime User Oct 6, 2014 #1 Hi masters. is there any way to cancel or exit a loop when a user pressed the back button. Hope someone can help. Thanks.
Hi masters. is there any way to cancel or exit a loop when a user pressed the back button. Hope someone can help. Thanks.
eps Expert Licensed User Longtime User Oct 6, 2014 #2 Without seeing any code or any kind of indication of what processing is being carried out it's a little difficult to help you on this. Can the processing in question be left in a background process and the main activity left to interact with the user? Upvote 0
Without seeing any code or any kind of indication of what processing is being carried out it's a little difficult to help you on this. Can the processing in question be left in a background process and the main activity left to interact with the user?
Erel B4X founder Staff member Licensed User Longtime User Oct 6, 2014 #3 You should never block the main thread in a loop. It will only cause problems. Upvote 0
LucaMs Expert Licensed User Longtime User Oct 6, 2014 #4 BarryW said: Hi masters. is there any way to cancel or exit a loop when a user pressed the back button. Hope someone can help. Thanks. Click to expand... DoEvents inside the loop Upvote 0
BarryW said: Hi masters. is there any way to cancel or exit a loop when a user pressed the back button. Hope someone can help. Thanks. Click to expand... DoEvents inside the loop
DonManfred Expert Licensed User Longtime User Oct 6, 2014 #5 LucaMs said: DoEvents inside the loop Click to expand... Possible but Erel said: You should never block the main thread in a loop. It will only cause problems. Click to expand... Upvote 0
LucaMs said: DoEvents inside the loop Click to expand... Possible but Erel said: You should never block the main thread in a loop. It will only cause problems. Click to expand...
LucaMs Expert Licensed User Longtime User Oct 6, 2014 #6 DonManfred said: Possible but Click to expand... Yes, I read that answer. This means that we should publish a Wish: "remove all kinds of loops from B4A" Last edited: Oct 6, 2014 Upvote 0
DonManfred said: Possible but Click to expand... Yes, I read that answer. This means that we should publish a Wish: "remove all kinds of loops from B4A"
eps Expert Licensed User Longtime User Oct 6, 2014 #7 LucaMs said: Yes, I read that answer. This means that we should publish a Wish: "remove all kinds of loops from B4A" Click to expand... No, it means that the Developer shouldn't place a potentially blocking loop in their main activity Upvote 0
LucaMs said: Yes, I read that answer. This means that we should publish a Wish: "remove all kinds of loops from B4A" Click to expand... No, it means that the Developer shouldn't place a potentially blocking loop in their main activity
LucaMs Expert Licensed User Longtime User Oct 6, 2014 #8 eps said: No, it means that the Developer shouldn't place a potentially blocking loop in their main activity Click to expand... You don't lock anything if you use DoEvents [Like] Last edited: Oct 6, 2014 Upvote 0
eps said: No, it means that the Developer shouldn't place a potentially blocking loop in their main activity Click to expand... You don't lock anything if you use DoEvents [Like]
Erel B4X founder Staff member Licensed User Longtime User Oct 6, 2014 #9 That is not correct. DoEvents only handles (some) graphic related messages. Upvote 0
LucaMs Expert Licensed User Longtime User Oct 6, 2014 #10 Erel said: That is not correct. DoEvents only handles (some) graphic related messages. Click to expand... Is it (DoEvents) different from .Net? Upvote 0
Erel said: That is not correct. DoEvents only handles (some) graphic related messages. Click to expand... Is it (DoEvents) different from .Net?
LucaMs Expert Licensed User Longtime User Oct 6, 2014 #12 LucaMs said: You don't lock anything if you use DoEvents [Like] Click to expand... Attachments lm Doevents Test.zip 12.3 KB · Views: 197 Upvote 0