Solved

Progress Update

Posted on 1998-08-18
3
150 Views
Last Modified: 2010-04-30
I have an CPU intensive VB app. that needs a progress display.  I don't no what my final values will be so I think a meter is out of the question. My main loop will run about 60K times. I tried putting a .Refresh in the loop but
it is flickery and slowed down my app dramatically.  I tried having it refresh every 5th time, never completed the refresh even once...  I need a veryyyy simple progress indicator that won't eat alot of cpu cycles and won't flicker.
0
Comment
Question by:jimmy3
3 Comments
 
LVL 1

Accepted Solution

by:
blwatkins earned 200 total points
ID: 1429608
Try putting a DoEvents directly after your refresh statement every 5th time.

0
 
LVL 3

Expert Comment

by:schworak
ID: 1429609
Well, you might do a DOEVENTS every 30th pass through the loop. Or a combination of a refresh and doevents. It really depends on what it is you are trying to get done. The DOEVENTS won't cause a flicker, but the refresh will almost always.

My personal preference is to do a DOEVENTS/REFRESH combo (doevents always goes last) every Nth second.

Example:

dim t as double
    :
    :
t=timer+5  ' t is 5 seconds into the future
 do while (bla = true)      ' <----- what ever your loop is
        :
        :
        :
    if t<timer then
        me.refresh        ' may not be needed in your situation
        doevents
        t=timer+5         ' 5 more seconds in the future
    endif
loop

This is really low CPU time except for that once each 5 (or what ever) seconds)
0
 

Author Comment

by:jimmy3
ID: 1429610
Can i split points i got the technically correct answer first,
then i got a more detailed comment that i would really consider a good answer.
0

Featured Post

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Access 2013 combo box not working 3 44
Add a task in Outlook from access 11 39
Visual Studio 2005 text editor 10 38
how to Classify of email (pdf attachments) 7 36
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question