PROGRAM Ordinal2;

    TYPE
        Color = (BLUE, GREEN, RED, MAROON); { Defining Color enumeration type  }
        SubColor =  GREEN..MAROON;  { Defining subrange on a previously defined}
                                    { ordinal type, here enumeration type      }

    VAR
        Color1, Color2: Color;
        Color3: SubColor;

BEGIN
    Color1 := RED;
    Color2 := GREEN;
    Color3 := RED;

    IF Color1 > Color2 THEN
        WriteLn('RED > GREEN (', Ord(RED), '>', Ord(GREEN), ')');

    WriteLn('Succ(BLUE)=', Succ(BLUE));
    WriteLn('Pred(RED)=', Pred(RED));
END.
