Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Finding the next or the previous value in a enumerated type

33 views
Skip to first unread message

ldries46

unread,
Nov 19, 2022, 9:05:54 AM11/19/22
to
I do have a enumated type:
type VALUE is (ABC, DEF, GHI, JKL, MNOP);
 Suppose I have a parameter with the value DEF is there a simple way to
get the next value like you can with integers in the way of V2 := V1 + 1
for instance OUT := NEXT( ABC).

Niklas Holsti

unread,
Nov 19, 2022, 9:32:37 AM11/19/22
to
Next value: VALUE'Succ (V1).
Previous value: VALUE'Pred (V1).

See http://www.ada-auth.org/standards/22rm/html/RM-3-5.html#I1732.

0 new messages