Navigation: Language Reference > 9 - Window and Report Attributes > Window and Report Attributes >====== RANGE (set range limits) ====== | |
RANGE(lower,upper)
RANGE | Specifies the valid range of data values the user may select in a SPIN control, or the range of values displayed in a PROGRESS control. |
lower | A numeric constant that specifies the lower inclusive limit of valid data (PROP:RangeLow, equivalent to {PROP:Range,1}). |
upper | A numeric constant that specifies the upper inclusive limit of valid data (PROP:RangeHigh, equivalent to {PROP:Range,2}). |
The RANGE attribute (PROP:RANGE) specifies the valid range of data values the user may select in a SPIN control. RANGE also defines the range of values that are displayed in a PROGRESS control.This attribute works in conjunction with the STEP attribute on SPIN controls. On a SPIN control, the STEP attribute provides the user with the valid choices within the range.
If no RANGE is set, and the FROM attribute is not used, PROP:RangeHigh returns “+Infinity”, and PROP:RangeLow returns “-Infinity”. When using the CREATE statement to create a SPIN control, these values are intentionally reversed, so that PROP:RangeHigh and PROP:RangeLow must be explicitly set.
PROP:RangeLow and PROP:RangeHigh are also applicable for LIST and COMBO controls with vertical scrollbars (Read Only). PROP:RangeLow returns the lower limit of possible PROP:VScrollPos values, and PROP:RangeHigh returns upper limit. The limits or boundaries mentioned in the description of PROP:VScrollPos are correct only if number of records in the list box source is less or equal to number of visible rows (i.e., for page loaded browses).
Example:
WinOne WINDOW,AT(0,0,160,400)
SPIN(@N4.2),AT(280,0,20,20),USE(SpinVar1),RANGE(.05,9.95),STEP(.05)
SPIN(@n3),AT(280,0,20,20),USE(SpinVar2),RANGE(5,995),STEP(5)
END
See Also: SPIN