setProgress

Sets the progress meter value in the interface.

Syntax

setProgress(percent)

Returns

Nothing

Parameters

percent (float)
the amount of progress from 0 to 100. A value higher than 100 can be used to indicate an unknown waiting time.

Usage

Fill the progress bar and set the percentage to any value between 0 and 100.

setProgress(0); // empty bar showin 0%
setProgress(50); // half full bar showing 50%
setProgress(50.6); // showing 51%
setProgress(100); // valid

Example of a filling progressbar.

for (i=0;i<=100;i++)
{
    setProgress(i);
    sleepMs(25);
}

If the values outside is out of range the full bar is shown as striped animation. This is useful for when a process is running that has no real progress indication but you like to show there is something going on.

setProgress(-1); // showing striped and no percentage
setProgress(101); // showing striped and no percentage