Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
23
Task/Undefined-values/Ada/undefined-values.ada
Normal file
23
Task/Undefined-values/Ada/undefined-values.ada
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
pragma Initialize_Scalars;
|
||||
with Ada.Text_IO; use Ada.Text_IO;
|
||||
|
||||
procedure Invalid_Value is
|
||||
type Color is (Red, Green, Blue);
|
||||
X : Float;
|
||||
Y : Color;
|
||||
begin
|
||||
if not X'Valid then
|
||||
Put_Line ("X is not valid");
|
||||
end if;
|
||||
X := 1.0;
|
||||
if X'Valid then
|
||||
Put_Line ("X is" & Float'Image (X));
|
||||
end if;
|
||||
if not Y'Valid then
|
||||
Put_Line ("Y is not valid");
|
||||
end if;
|
||||
Y := Green;
|
||||
if Y'Valid then
|
||||
Put_Line ("Y is " & Color'Image (Y));
|
||||
end if;
|
||||
end Invalid_Value;
|
||||
Loading…
Add table
Add a link
Reference in a new issue