--
-- This is a test of records.
--
package test21 is body
    i : integer;
    type complex is record r, i : float; end record;
    type pair is record first, second : complex; end record;
    c : complex;
    p : pair;
    procedure print() is begin
	write("    (", c.r, ", ", c.i, ")");
    end;
begin 
    c.r := 1.0;
    c.i := 0.0;
    p.first := c;
    c.r := 0.0;
    c.i := 1.0;
    p.second := c;
    c := p.first;
    write ("The first complex number should be (1.0, 0.0):");
    print();
    c := p.second;
    write ("The second complex number should be (0.0, 1.0):");
    print();
    if p.first.r <> p.second.r then 
	write ("And these two complex numbers are not equal!");
    elsif p.first.i <> p.second.i then 
	write ("And these two complex numbers are not equal!");
    else
	write ("And these two complex numbers ARE equal?");
    end if;
end.
