From: "Bruce Detter" <bruce.detter@lmco.com>
Subject: GNAT Stream Read processing problem
Date: 1999/01/05
Date: 1999-01-05T00:00:00+00:00 [thread overview]
Message-ID: <76tsgd$s0o1@svlss.lmms.lmco.com> (raw)
I am using GNAT 3.10p on NT4.0. I have the following code written to read a
binary file:
type Position is
record
x, y: Float;
end record;
type PositionArray is array (1 .. 5000) of Position;
type Data_Points is
record
elements: Long_Integer;
PS: PositionArray;
end record;
type DataArray is array (1 .. 256) of Data_Points;
Data: DataArray;
ndx: Long_Integer := 0;
procedure LoadData is
Dat: File_Type;
S: Stream_Access;
i: Long_Integer;
begin
Open(Dat, In_File, "Data.bin");
S := Stream(Dat);
while not End_Of_File(Dat) loop
Long_Integer'Read(S, Data(ndx).elements);
for i in 1 .. Data(ndx).elements loop
Float'Read(S, Data(ndx).PS(i).x);
Float'Read(S, Data(ndx).PS(i).y);
end loop;
ndx := ndx + 1;
end loop;
Close(Map);
end LoadData;
When I compile this no matter what type is specified for the Read attribute
and the data element to be read into, I get the following errors three
times:
... expected type "Standard.Integer"
... found type "Standard.Long_Integer"
and it points me to the second parameter of each 'Read. Can someone suggest
what it is I'm doing wrong.
Thanks in advance...
BCD3
next reply other threads:[~1999-01-05 0:00 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-01-05 0:00 Bruce Detter [this message]
1999-01-05 0:00 ` GNAT Stream Read processing problem Tom Moran
1999-01-05 0:00 ` Bruce Detter
1999-01-06 0:00 ` dewar
1999-01-06 0:00 ` Matthew Heaney
1999-01-06 0:00 ` Bruce Detter
1999-01-06 0:00 ` Elaborate compile-time error messages (was: GNAT Stream Read ...) Larry Kilgallen
1999-01-06 0:00 ` bourguet
1999-01-06 0:00 ` Marin David Condic
1999-01-11 0:00 ` Georg Bauhaus
1999-01-13 0:00 ` Simon Wright
1999-01-07 0:00 ` dewar
1999-01-07 0:00 ` Larry Kilgallen
1999-01-10 0:00 ` robert_dewar
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox