Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

Ada Programming/Attributes/'Pred

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

Attributes 'Pred __TOC__ Description X'Pred(Y) is an Ada attribute where X is any discrete type and Y is a value of that type. This attribute represents the discrete value that has a position number of one less than the input parameter. The returned discrete value type is the base type of discrete type. If the input parameter is the First value of the discrete type, then a CONSTRAINT_ERROR exception will be raised. Example type My_Enum is (Enum1, Enum2, Enum3); ... Assert (My_Enum'Pred (Enum2) = Enum1); OK Assert (My_Enum'Pred (Enum1) = Enum3); Wrong See also Wikibook Ada Programming Ada Programming/Attributes/'Succ Ada Reference Manual 13 3 Operational and Representation Attributes K Language-Defined Attributes Pred