Processing during loop i.e. Application.Process Messages 
Author Message
 Processing during loop i.e. Application.Process Messages

Hello,
    I am writting a program in VB. In many programs I've written in
Delphi, you have something called 'Application.ProcessMessages;' to call
right after the execution of a Do..Loop for example. This allows the
loop to continue but the program to process other messages going on
during the time of the loop. Can anyone tell me if Visual Basic has
something similar that can be done to allow other processing during a
large loop? Any help would be greatly appreciated. Thanks in advance.

Marc

**********For direct replies...delete 'removethis.' from email
address.**********



Thu, 16 Nov 2000 03:00:00 GMT  
 Processing during loop i.e. Application.Process Messages

Quote:
>     I am writting a program in VB. In many programs I've written in
> Delphi, you have something called 'Application.ProcessMessages;' to call
> right after the execution of a Do..Loop for example. This allows the
> loop to continue but the program to process other messages going on
> during the time of the loop. Can anyone tell me if Visual Basic has
> something similar that can be done to allow other processing during a
> large loop? Any help would be greatly appreciated. Thanks in advance.

Sure you're posting this in the right NG ?
Anyway, it's called DoEvents I believe...

HTH,

        Niels.

-------------------------------------------------------------------------
Niels Vanspauwen

Faculty of Civil Engineering
Department of Computer Science

E-Mail: Niels.Vanspauwen!NSPM!Student.Kuleuven.Ac.Be

-------------------------------------------------------------------------



Fri, 17 Nov 2000 03:00:00 GMT  
 Processing during loop i.e. Application.Process Messages

Try puting DoEvents within the loop.



Quote:
> Hello,
>     I am writting a program in VB. In many programs I've written in
> Delphi, you have something called 'Application.ProcessMessages;' to call
> right after the execution of a Do..Loop for example. This allows the
> loop to continue but the program to process other messages going on
> during the time of the loop. Can anyone tell me if Visual Basic has
> something similar that can be done to allow other processing during a
> large loop? Any help would be greatly appreciated. Thanks in advance.

> Marc

> **********For direct replies...delete 'removethis.' from email
> address.**********



Fri, 17 Nov 2000 03:00:00 GMT  
 Processing during loop i.e. Application.Process Messages
Marc,

As the others stated, DoEvents is a nice way to release program execution
and allow other messages to process on the system.

However, if you want to process a loop in the background of your application
and still have that application accept input, you will need to look into a
multi-threaded application.

The classic example is having a "Stop" button to halt execution of the loop
if the user wished to terminate.  While you don't need a multi-threaded app
to accomplish this in a lot of scenarios, it does come in handy for this and
a myriad of other tasks.

Best of luck to you!

Ron Sparks
Sr. Software Engineer
Travel Services International
Delray Beach, FL

Quote:

> Hello,
>     I am writting a program in VB. In many programs I've written in
> Delphi, you have something called 'Application.ProcessMessages;' to call
> right after the execution of a Do..Loop for example. This allows the
> loop to continue but the program to process other messages going on
> during the time of the loop. Can anyone tell me if Visual Basic has
> something similar that can be done to allow other processing during a
> large loop? Any help would be greatly appreciated. Thanks in advance.

> Marc

> **********For direct replies...delete 'removethis.' from email
> address.**********



Tue, 02 Jan 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Please Help: How to intercept message processing loop in VB form

2. processing messages to break loop

3. Timer on hold during application processing

4. process message in VB applications

5. VB6 Cancel during process...

6. Automatically create DSN during the installation process.

7. Cancelling file writing process during long writes

8. The way of getting another event during processing of a event

9. Disabling mouse during processing.

10. Disabling mouse during processing.

11. Discarding keystrokes during processing.

12. HELP!!! Distribution disks provoke error during install process

 

 
Powered by phpBB® Forum Software