I've been asking my share of questions lately so I though try to
contribute also. Recently there has been a thread regarding long
processes and displaying feedback to the user. I would like to toss
in my $0.02 on this. First I agree with the statements that using a
progressbar (or gear) takes a major hit in the performance
department. I have tried many different ways of providing feedback
and all will severely impact the time it takes to do any particular
task. Some more than others. I also concur that if you have imbedded
loops, always keep the call to update the progressbar in the outer
loop. Even then, the progressbar call can be called many times a
second needlessly slowing down the routine.
In one of the posts someone reported a very large image (don't recall
the size off hand) and took 6-7 seconds to process. The time seems
very adequate for the size of the image but I'll bet the progressbar
was called far to often and slowed down the routine. Twice a second
is the fastest you would ever want to make the call to the
progressbar. I choose either an index var or the outer loop var and I
mod() it. If it returns zero (you can use any number) then call the
progress bar. Like this < If X mod(10)=0 then PBar1.Value=X> This
allows me to make the progressbar call 1/10 of time and speed up the
total time to complete the routine. You can play around with the
value to put in the mod statement, make sure you will get the value
you expect from the number you use when comparing, and this will call
the progressbar more or less often depending on the values. I shoot
for no more than twice a second and no less than once a second. This
is the best compromise I've found to accomplish this task and stay
within the OS interface guidelines.
Using RB's rect objects are much faster than using the progressbar if
you want to make you own progressbar. You have to do all the math and
updating yourself, but is not difficult. Simply displaying <28%
Competed...> in a static text object is another alternative. This
method has its faults when a job is particularly long an it may take
several minutes to increment the percentage and you have to do the
math too. I've even used a style similar to Flash and use a string
like this; <prog="•,••,•••,••••,•••••"> and
<progress.text=prog.NthField(",",x)> where I display one of the five
segments of the string at a time (just to show it's working and not
stalled - and thats the whole point - feedback for the user)
I hope this helps and I also hope I didn't bore the members who were
saying 'I knew that - Duh' :-)
Craig _______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>