comp.lang.ada
 help / color / mirror / Atom feed
From: Niklas Holsti <niklas.holsti@tidorum.invalid>
Subject: Re: Finding the next or the previous value in a enumerated type
Date: Sat, 19 Nov 2022 16:32:33 +0200	[thread overview]
Message-ID: <jts7o1FpgidU2@mid.individual.net> (raw)
In-Reply-To: <nnd$1f48a501$398eed6c@11974fcc584b8061>

On 2022-11-19 16:05, ldries46 wrote:
> 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).


Next value: VALUE'Succ (V1).
Previous value: VALUE'Pred (V1).

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

      reply	other threads:[~2022-11-19 14:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-19 14:05 Finding the next or the previous value in a enumerated type ldries46
2022-11-19 14:32 ` Niklas Holsti [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox