-- A simple example showing a record
with ada.text_io; use ada.text_io;
with ada.integer_text_io; use ada.integer_text_io;
procedure boxexample is
type Box is record
l, w: Integer := 0;
end record;
procedure put_line(aBox: Box) is
begin
put(aBox.l);
put(aBox.w);
new_line;
end put_line;
b1, b2: Box;
begin
b1.l := 11;
b1.w := 22;
b2 := (33, 44);
put_line(b1);
put_line(b2);
if b1 = b2 then
put_line("Same");
else
put_line("Different");
end if;
b1 := b2;
put_line(b1);
put_line(b2);
end boxexample;