TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy


Options: Use Classic View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Simon Wright <[log in to unmask]>
Sat, 17 Feb 2001 07:07:29 +0000
text/plain (27 lines)
> From: Greg Bek <[log in to unmask]>

> I tried a couple of different things before your final line of
> output:
>     Ada.Text_Io.Put_Line ("Image is " & Month_Type'Image (Control_Data.Month));
> With Apex that raises constraint error, as the incorrect value is now
> being used.

GNAT 3.13p says Program_Error; interestingly, at the line

    type ZZZ_Single_Value_Control_Type (Field : ZZZ_Control_Fields := Date) is

though the debugger shows the Put_Line in the call stack.

> I also tried
>    case Control_Data.Month is
>         when January .. December =>
>             Ada.Text_Io.Put_Line ("Valid month");
>         when others =>
>             Ada.Text_Io.Put_Line ("Invalid month");
>     end case;
> And got "Invalid Month" output.

GNAT says "Valid Month".