Ada Programming/Attributes/'First
Tools
General
Sister projects
In other projects
X'First, whereX is anyscalar subtype (for example integer, enumerated, real), is anattribute that represents the first value (lower bound) in the range ofX.
A'First, whereA is an array, denotes the first index value. For more-dimensional arrays,A'First(N) denotes the first index value of the Nth dimension (N must be static).
typeMy_Enumis(Enum1, Enum2, Enum3);typeMy_Intisrange-1 .. 5;...pragmaAssert (My_Enum'First = Enum1);-- OKpragmaAssert (My_Int'First = -1);-- OKpragmaAssert (My_Int'First = 0);-- Wrong!