Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Often statistics are used as a drunken man uses lampposts -- for support rather than illumination.


devel / comp.lang.ada / Finding the next or the previous value in a enumerated type

SubjectAuthor
* Finding the next or the previous value in a enumerated typeldries46
`- Re: Finding the next or the previous value in a enumerated typeNiklas Holsti

1
Finding the next or the previous value in a enumerated type

<nnd$1f48a501$398eed6c@11974fcc584b8061>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9036&group=comp.lang.ada#9036

  copy link   Newsgroups: comp.lang.ada
Date: Sat, 19 Nov 2022 15:05:50 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0
Newsgroups: comp.lang.ada
Content-Language: en-GB
From: bertus.dries@planet.nl (ldries46)
Subject: Finding the next or the previous value in a enumerated type
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Message-ID: <nnd$1f48a501$398eed6c@11974fcc584b8061>
Organization: KPN B.V.
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.szaf.org!news.uzoreto.com!feeder.usenetexpress.com!tr1.eu1.usenetexpress.com!94.232.112.244.MISMATCH!feed.abavia.com!abe004.abavia.com!abp001.abavia.com!news.kpn.nl!not-for-mail
Lines: 6
Injection-Date: Sat, 19 Nov 2022 15:05:51 +0100
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
 by: ldries46 - Sat, 19 Nov 2022 14:05 UTC

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

Re: Finding the next or the previous value in a enumerated type

<jts7o1FpgidU2@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9037&group=comp.lang.ada#9037

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.szaf.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: niklas.holsti@tidorum.invalid (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
Lines: 13
Message-ID: <jts7o1FpgidU2@mid.individual.net>
References: <nnd$1f48a501$398eed6c@11974fcc584b8061>
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: <nnd$1f48a501$398eed6c@11974fcc584b8061>
 by: Niklas Holsti - Sat, 19 Nov 2022 14:32 UTC

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.


devel / comp.lang.ada / Finding the next or the previous value in a enumerated type

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor