with Ada.Text_IO;
use Ada.Text_IO;
procedure Record2 is
type DATE is
record
Month:Integer range 1..12;
Day:Integer range 1..31;
Year:Integer range 1776..2010;
end record;
type PERSON is
record
Name :String(1..15);
Birth_Day:DATE;
Age:Integer;
Sex:Character;
end record;
Self,Mother,Father:PERSON;
My_BirthDay_Year: Integer renames Self.Birth_Day.Year;
begin
Self.Name:="John Q Doe ";
Self.Age:=21;
Self.Sex:='M';
Self.Birth_Day.Month:=10;
Self.Birth_Day.Day:=18;
Self.Birth_Day.Year:=1938;
My_BirthDay_Year:=1938;-- identical to previous statement
Mother:=Self;
Father.Birth_Day:=Mother.Birth_Day;
Father.Birth_Day.Month:=Self.Birth_Day.Month-4;
Mother.Sex:='F';if Mother/=Self then
Put_Line("Mother is not equal to self");
end if;
end Record2;