Solved

Progress Update

Posted on 1998-08-18
3
153 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

733 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