Revolution is very slow to refresh fields. How can I speed it up?
Geoff Canyon
gcanyon at inspiredlogic.com
Sat Apr 8 14:34:45 EDT 2006
On Apr 7, 2006, at 9:31 AM, Rob Cozens wrote:
> Geoff, et al:
>
>> I generally check the ticks and update based on that:
>
> How do you know in advance the total ticks to complete the operation?
The ticks to complete the operation isn't used for anything. Suppose
I have to process the elements in an array, and there can be any
number of elements in the array. I might do something like this:
set the endValue of scrollbar "progress" to \
the number of lines of the keys of myArray
put ticks() + 10 into tTimer
put 0 into tProgress
repeat for each element tKey in myArray
add 1 to tProgress
if ticks() > tTimer then
put ticks() + 10 into tTimer
set the thumbPosition of scrollbar "progress" to tProgress
end if
-- process element tKey
end repeat
This guarantees that the scrollbar will update a maximum of six times
per second. If there are 10,000 elements in myArray and they process
quickly, this means that the scrollbar is being updated too often
unless the scrollbar is 10,000 pixels wide ;-)
regards,
Geoff
More information about the use-livecode
mailing list