有同样的错误,我忘记了它是如何工作的,所以经过反复试验,我发现
WITH Ada.Text_IO;
USE Ada.Text_IO;
WITH Ada.Integer_Text_Io;
USE Ada.Integer_Text_IO;
WITH Ada.Float_Text_IO;
USE Ada.Float_Text_IO;
--ecrire(x) lire(x) put(x) get(x);
--errors handling
WITH Ada.IO_Exceptions;
--Additionnal log functions alike
WITH Ada.Numerics.Elementary_Functions;
USE Ada.Numerics.Elementary_Functions;
-- WITH Ada.Text_Io;
-- USE Ada.Text_Io;
-- WITH Ada.Integer_Text_Io;
-- USE Ada.Integer_Text_Io;
procedure remplit is
type tablo is array(1.. 5) of float;
Procedure toto ( Init : in float ; T : out tablo ) is
Begin
For I in T'first + 1..T'last loop
T(i) := Init * float(i);
put(t(i));
End loop;
End toto;
T : tablo;
begin
toto(1.5, T);
end remplit;
而不是产生此错误的...
WITH Ada.Text_IO;
USE Ada.Text_IO;
WITH Ada.Integer_Text_Io;
USE Ada.Integer_Text_IO;
WITH Ada.Float_Text_IO;
USE Ada.Float_Text_IO;
--ecrire(x) lire(x) put(x) get(x);
--errors handling
WITH Ada.IO_Exceptions;
--Additionnal log functions alike
WITH Ada.Numerics.Elementary_Functions;
USE Ada.Numerics.Elementary_Functions;
-- WITH Ada.Text_Io;
-- USE Ada.Text_Io;
-- WITH Ada.Integer_Text_Io;
-- USE Ada.Integer_Text_Io;
type tablo is array(1.. 5) of float;
Procedure remplit ( Init : in float ; T : out tablo ) is
Begin
For I in T'first + 1..T'last loop
T(i) := Init * float(i);
put(t(i));
End loop;
end remplit;
顺便说一句,这与包裹无关。