comp.lang.ada
 help / color / mirror / Atom feed
* GNAT Stream Read processing problem
@ 1999-01-05  0:00 Bruce Detter
  1999-01-05  0:00 ` Tom Moran
  1999-01-06  0:00 ` dewar
  0 siblings, 2 replies; 14+ messages in thread
From: Bruce Detter @ 1999-01-05  0:00 UTC (permalink / 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







^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~1999-01-13  0:00 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-01-05  0:00 GNAT Stream Read processing problem Bruce Detter
1999-01-05  0:00 ` 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   ` 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
1999-01-06  0:00   ` GNAT Stream Read processing problem Bruce Detter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox