Wait for a sub process to finish

IamBot

Member
Licensed User
Longtime User
In my program I'm calling a sub routine in order to download a couple of files which can take some time. My program should not proceed until every file has been fully downloaded. Is there an effective way to 'pause' the current activity until the sub routine has reached 'end sub'?
 

mc73

Well-Known Member
Licensed User
Longtime User
In such cases, I use a
B4X:
ProgressDialogShow2("yourMessage",False)
which I hide at the end of the sub, while at the same time (at the end of the sub) I continue by calling a new sub containing the rest of components I wish to load. You can also experiment with a boolean flag set to true, by looping until the sub is finished. But I don't know if this may cause unwanted behavior (a crash for e.g.).
 
Upvote 0
Top