From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-3.2 required=3.0 tests=BAYES_00,NICE_REPLY_A, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader01.eternal-september.org!news.szaf.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: Finding the next or the previous value in a enumerated type Date: Sat, 19 Nov 2022 16:32:33 +0200 Organization: Tidorum Ltd Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: individual.net G9hhVI5yqbtejCsK9PNB5QK1nsNGlOTr0L9oudradrUWc624zQ Cancel-Lock: sha1:7U96/rYhT9g8W9trbn/r6X9NRQQ= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Content-Language: en-US In-Reply-To: Xref: reader01.eternal-september.org comp.lang.ada:64632 List-Id: 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.