INRANGE (check number within range)

Top  Previous  Next

 

INRANGE(expression,low,high)

INRANGE

Return number in valid range.

expression

A numeric constant, variable, or expression.

low

A numeric constant, variable, or expression of the lower boundary of the range.

high

A numeric constant, variable, or expression of the upper boundary of the range.

The INRANGE procedure compares a numeric expression to an inclusive range of numbers. If the value of the expression is within the range, the procedure returns the value 1 for "true." If the expression is greater than the high parameter, or less than the low parameter, the procedure returns a zero for "false."

Return Data Type:

LONG

Example:

IF INRANGE(Date % 7,1,5) !If this is a week day

DO WeekdayRate          !use the weekday rate

ELSE                     !Otherwise

DO WeekendRate          !use the weekend rate

END