Please enable JavaScript to view this site.

 

The range operator .. specifies an integer interval. Both endpoints are included, and the lower endpoint must not exceed the upper endpoint.

 

It is usually used in conjunction with the membership operator in [] to test if an expression belongs to a set of values.

bIsTeenager = nAge in [13..19] // includes ages 13 and 19

The range operator can also be used in a switch statement.

switch nAge
   case 13..19
      sRESULT = 'teenager'
   case 50..59
      sRESULT = 'in the fifties'
endswitch

For example, [6..7] is a valid range; but reversing these bounds to [7..6] is incorrect.

 


Topic 133900, last updated on 16-Oct-2026