Slider objects allow a numerical value to be displayed in “thermometer” format, indicating the progress toward completing a task.
Start by dragging a Progress Indicator object from the Object Library to the form.
The minimum and maximum values are required. Set these to the values you want to use for zero progress (minimum) and fully completed progress (maximum). These default to 0 and 100, but you can use any numeric values.
Now go to the formula panel and enter the formula that will be used to calculate the progress value. Usually this is a variable, but any formula that calculates a numeric result can be used. In this example, the variable progressValue will contain the numeric value. This formula also uses the catcherror( function, this makes sure that the default value is zero if the variable hasn’t been defined yet.
Now we can write code with a loop like this that will cause the Progress Indicator to gradually fill up as the code runs over and over again.
letfileglobal progressValue = 0
for progressValue,0,100
showvariables progressValue
endloop
Of course this example is kind of silly since it doesn’t do anything except display the prograss bar. In a real application you would want to perform additional tasks inside the loop.
Progress Indicator objects have a half dozen options.
The pop-up menu switches between bar and spinning styles.
The bar style is always horizontal. It is not possible to display a vertical progress indicator.
Progress Indicators may be one of three fixed heights: Regular, Small and Mini. These are the only sizes available – see Cocoa Objects for more detail about the reasons for this limitation.
Use this option if it’s impossible to calculate a numerical progress value, but you still want to indicate that something is happening. When this option is checked, the indicator will animate, but it won’t show a specific progress value.
To stop the animation, set the progress value to zero. For any non-zero value, the indicator will animate.
If this option is un-checked, the Progress Indicator object will disappear completely if the progress value is zero. It will only appear when the progress value is non-zero.
The Minimum and Maximum values set the range of possible progress values. You can use any values you want, but the Minimum must be less than the Maximum.
The values don’t have to be integers. For example, you could set the Minimum to 0, and the Maximum to 1, then use progress values from 0 to 1, for example 0.5 for “half complete.”
See Also
History
Version | Status | Notes |
10.0 | New | New in this version. (Note: This object was not documented until 10.2.) |