DlgProgressBar.GetRange

table DlgProgressBar.GetRange ( 

number ControlID )

Example 1

range = DlgProgressBar.GetRange(CTRL_PROGRESS_BAR_01);

Gets the range of the '01' progress bar control and stores it in the table "tRange".

Example 2

tRange = DlgProgressBar.GetRange(CTRL_PROGRESS_BAR_02);

nNumberOfSteps = tRange.End - tRange.Begin;

Dialog.Message("Progress Bar Fact:", "This progress bar contains " .. nNumberOfSteps .. " steps!");

Gets the range of the '02' progress bar control and stores it in the table "tRange". The number of steps in this control is calculated and displayed to the user.

Example 3

-- Get the range and position of the progress bar control
tRange = DlgProgressBar.GetRange(CTRL_PROGRESS_BAR_01);

nPos = DlgProgressBar.GetPos(CTRL_PROGRESS_BAR_01);

-- Calculate the percent complete
nPercent = (nPos - tRange.Begin) / (tRange.End - tRange.Begin);

Gets the range and current position of the '01' progress bar control. The percent complete is calculated and stored in the variable "nPercent" as a decimal value (e.g. 0.473).

See also:  Related Actions