Progress bars

Bill bill at bluewatermaritime.com
Sat Mar 12 18:49:47 EST 2005


That is such a nice explanation and example for a progress bar. I wish the
text files I imported were big enough so I could use it. The only thing that
takes a long time in my stacks is opening them when the MySql is first
accessing and whenever you refresh the MySql connection.

Do you have any idea how to get some numbers from that lengthy MySQL process
so that I can use your progress bar code for that because it sometimes looks
like the program has crashed when it is doing the MySQL load.


On 3/12/05 6:46 PM, "Richard Gaskin" <ambassador at fourthworld.com> wrote:

> Lars Brehmer wrote:
>> I can't seem to find a tutorial or any layman's explanations on putting
>> a simple progress bar into my stacks.  I have a stack that imports text
>> data and creates the cards to store it on.  If the file is large, it
>> takes a while, so I'd like to build in a progress bars (on a separate
>> subStack?) to give an idea how long the task will take.  Where does it
>> go and how do you set it up? A tutorial or a sample stack that has one
>> would be terrific! Can anyone help me out here?
> 
> A MINI-TUTORIAL ON PROGRESS BARS
> --------------------------------
> 
> Rev includes a flexible object type called "scrollbar" which serves as
> standard scrollbars and also sliders and progress bars as well.
> 
> The three most relevant properties for use as a progress bar are:
> 
> - thumbPos: the position of the indicator
> - startValue: the beginning of the progress range
> - endValue: the end of the progress range
> 
> Check out the discussion of those entries in the Transcript Dictionary.
> 
> It's handy to use the abbreviated form of "scrollbar", which is simply "sb".
> 
> You could set up a progress bar in your text processing script like this:
> 
> 
> on ProcessFile
>    -- Get file data:
>    answer file "Select a file:"
>    if it is empty then exit to top
>    put url ("file:"&it) into tData
>    put the number of lines of tData into tNumLines
>    --
>    -- Setup progress bar:
>    set the startValue of sb "progress" to 0
>    set the endValue of sb "progress" to tNumLines
>    set the thumbpos of sb "progress" to 0
>    show sb "progress"
>    --
>    -- process the text in a loop:
>    put 0 into i
>    repeat for each line tLine in tData
>      add 1 to i
>      set the thumbPos of sb "progress" to i
>      --
>      DoSomethingWith tLine
>    end repeat
>    --
>    hide sb "progress"
> end ProcessFile
> 
> 
> 
> --
>   Richard Gaskin
>   Fourth World Media Corporation
>   __________________________________________________
>   Rev tools and more: http://www.fourthworld.com/rev
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
> 
> 

            |    |    |
           )_)  )_)  )_)
          )___))___))___)\
         )____)____)_____)\\
       _____|____|____|____\\\__
-------\                   /--------- http://www.bluewatermaritime.com
 ^^^^^ ^^^^^^^^^^^^^^^^^^^^^
  ^^^^      ^^^^     ^^^    ^^
       ^^^^      ^^^

24 hour cell: (787) 378-6190
fax: (787) 809-8426

Blue Water Maritime
P.O. Box 91
Puerto Real, PR 00740





More information about the use-livecode mailing list