Ada Programming/Attributes/'Range

Description
The meaning of the attribute depends on the meaning of the prefix X.

If X is a scalar subtype, X'Range represents the range of valid values for that subtype, i.e. it is the same as the subtype itself.

If X is a constrained array subtype or an array object, X'Range denotes the index range of X.

In any case, X'Range is equivalent to X' .. X', but X is only evaluated once.

If X is multidimensional, the attribute needs a static parameter N to identify the N-th index; 'Range (1) is the same as 'Range.

X'Range (N) is equivalent to X'(N) .. X'(N), but X is only evaluated once.

Examples
T  110 A  T  S                    A   T  S              A   T  T   S   B   T    S    SB  B 2  5 M  Boolean T  S

OA A           OB B 2  5

Wikibook

 * Ada Programming

Ada Reference Manual


|Range