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

    From ldries46@21:1/5 to All on Sat Nov 19 15:05:50 2022
    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).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Niklas Holsti@21:1/5 to All on Sat Nov 19 16:32:33 2022
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)