Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikibooksThe Free Textbook Project
Search

Ada Programming/Attributes/'First

From Wikibooks, open books for an open world
<Ada Programming |Attributes
Computing »Computer Science »Computer Programming »Ada Programming

Ada. Time-tested, safe and secure.
Ada. Time-tested, safe and secure.

Description

[edit |edit source]

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).

Example

[edit |edit source]
type My_Enumis (Enum1, Enum2, Enum3);type My_Intisrange -1 .. 5;...pragmaAssert (My_Enum'First = Enum1);-- OKpragmaAssert (My_Int'First  = -1);-- OKpragmaAssert (My_Int'First  =  0);-- Wrong!

See also

[edit |edit source]

Wikibook

[edit |edit source]

Ada Reference Manual

[edit |edit source]
Retrieved from "https://en.wikibooks.org/w/index.php?title=Ada_Programming/Attributes/%27First&oldid=3250045"
Category:
Hidden category:

[8]ページ先頭

©2009-2026 Movatter.jp