CollegeSeniorProjectNeedsHelp

I seem to have a semi-unique situation. I have to procedures that run in my program that last for a specific time frame (using the timers). The good news is, the timers work great! The bad news is I am having to use While (or do until) loops as other things are happening during the time frame. These loops utilize 100% of the processor time killing off the ability of the program to do the other functions.

Shy of putting in "MsgBox" commands to force the processor to pause, I wanted to try using the background workers to process the while loop. This would work great except now my program doesn't wait for the events to complete before continuing on with the program. As the first loop is dialing a phone number and then waiting for an answer or call failure or dialling time out, I do need for the program to wait until one of those events occurs.

How can I get the program to wait on the background worker to finish without adding yet another while loop I tried to have the background worker act as a function, but VB does NOT like that at all. I had figured that if I did a variable=start.backgroundworker() the program would wait but not kill my computer for all the other commands.

Can someone please point me in the right direction on this I am really at a loss on how I can use the ASYNC in the background but still wait on the ASYNC process to complete before continuing.

Thanks.



Re: Visual Basic General Background Worker

weirdbeardmt

Have a look at Application.DoEvents...




Re: Visual Basic General Background Worker

CollegeSeniorProjectNeedsHelp

WOW! It WORKS!

Thanks weirdbeard, that is exactly what I was needing.