Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Progress Update

Posted on 1998-08-18
3
Medium Priority
?
168 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 400 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

618 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