Hi can someone help me with a little code to advance a progress bar for about a 4 second operation that involves getting the files of a folder and sending the list of files through several repeat loops to do some error checking regarding the file names, types,etc then does some math, etc, locks the screen, resizes some groups, and then eventually unlocks the screen.
I was using a handler in the stack and a progress bar i got from tactile media hence the "tm" before the commands in the script below. Then where ever I could find a repeat loop sticking the "ShowProgress" handler in to try and advance the progress bar but it wash"t really working well at all. Is there a way I can get it to march along for say 4 seconds and then when the script ends just hide it? Any help would be appreciated.
Dave
global tCurrentProgress
on ShowProgress
set the tmEndValue of control "myProgress" to 20
put the tmThumbPos of control "myProgress" into tCurrentProgress
if tCurrentProgress >= the tmEndValue of control "myProgress" then
put 0 into tCurrentProgress
else
add 1 to tCurrentProgress
end if
set the tmThumbPos of control "myProgress" to tCurrentProgress
end ShowProgress
advancing my progress bar
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: advancing my progress bar
Hi,
I only know how to do this for regular progress bars. First of all, note that progress bars are not time-related. They are activity-related and are updated using counters. For example, if you have a list with files:
Kind regards,
Mark
I only know how to do this for regular progress bars. First of all, note that progress bars are not time-related. They are activity-related and are updated using counters. For example, if you have a list with files:
Code: Select all
set the endValue of scrollbar "Progress" to the number of lines of myFileList
put 0 into myCounter
repeat for each line myFile in myFileList with messages
add 1 to myCounter
// do something with file myFile
set the thumbPos of scrollbar "Progress" to myCounter
wait 0 millisecs with messages
end repeat
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: advancing my progress bar
Thanks,
That should help I will give it a try.
Dave
That should help I will give it a try.
Dave