comp.lang.ada
 help / color / mirror / Atom feed
* Stream IO - Correct usage of Set_Index
@ 1999-03-01  0:00 Rofi
  1999-03-02  0:00 ` dennison
  1999-03-02  0:00 ` bourguet
  0 siblings, 2 replies; 6+ messages in thread
From: Rofi @ 1999-03-01  0:00 UTC (permalink / raw)


Platform : Solaris, Linux

Compiler : GNAT 3.10p

Already Looked in : 
	Ada Reference Manual;
	Programming in Ada95 by John Barnes; 
	www.dejanews.com, searching for streams in comp.lang.ada.


Hi

	I am trying to use Stream_IO to create (and use) a file that contains
different data types.  Creating, writing to and reading from the file in a
sequential manner is not a problem.
	My problem is using Set_Index to move to a particular data structure
that is situated part way through the file.  How do I find out the size of
a data structures so that I can use Set_Index correctly.

E.G.

type1 and type2 are of difference sizes.


Start of File

	Var1 of type1
	Var2 of type1
	Var3 of type1
	Var4 of type1
	Var5 of type2
	Var6 of type2     <-- how would I access this variable directly
	.....

End of File

	I have tried using the attribute Size which appears to return the
size of the datastructure in bits.  On this compiler I can divide this by 8
and I get the correct values but this method seem to me to be very Adalike.
Am I missing something monumentally obvious or ...... ?

Cheers

Rofi










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

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

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-03-01  0:00 Stream IO - Correct usage of Set_Index Rofi
1999-03-02  0:00 ` dennison
1999-03-04  0:00   ` Rofi
1999-03-04  0:00     ` dennison
1999-03-02  0:00 ` bourguet
1999-03-04  0:00   ` Rofi

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