A range is an integer or a pair of integers.

A range denotes the integers that lie between its contents inclusively.

If two integers are present, the second integer must be greater than or equal to the first integer. Examples of ranges:

      10 20
      0 1000
      -1 1

Semantics of ranges

If the second argument is missing then it is taken to be equal to the first argument. A range represents the integers greater than or equal to its first argument and less than or equal to its second argument.

For example,

denotes the number 10.
 0 3
denotes the four numbers 0, 1, 2, and 3.

Using a variable as a range element

A numeric variable can be used as one of the integers in a range. In this case, the value of the variable is used for that side of the range. A numeric variable cannot be used in ranges that are part of command line options or in the CQL header, however.

Note on the use of ranges in the grammar

Some CQL filters take what we call an optional range parameter, or just optional range. This is a range that might or not be present. For example, the line filter can be used with or without a range.

Filters that accept ranges

The following filters accept an optional range: consecutivemoves, line, find, and the direction filters.