From: tmoran@bix.com (Tom Moran)
Subject: Re: GNAT Stream Read processing problem
Date: 1999/01/05
Date: 1999-01-05T00:00:00+00:00 [thread overview]
Message-ID: <36928385.8520314@news.pacbell.net> (raw)
In-Reply-To: 76tsgd$s0o1@svlss.lmms.lmco.com
>... 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.
Yes. You are using a Long_Integer, i, to index PS, which, takes a
Standard_Integer as an index.
Note that "for i in" has 'i' take its type from its range, which is
"1 .. Data(ndx).elements" and " elements: Long_Integer;" so i is a
Long_Integer. Note also that PS is a "type PositionArray is array (1
.. 5000)" and, since it doesn't say otherwise for the range, 1 .. 5000
is taken to mean "Standard_Integer range 1 .. 5000" so PS takes a
Standard_Integer as an index.
You can either decide that Position_Array should be indexed by
Long_Integer, or you can use "Integer(i)" as a subscript to convert
the long i to a regular integer. (With the obvious possibility of an
out of range value, either in converting i to a Standard_Integer, or
in trying to use a Standard_Integer outside the 1 .. 5000 range).
next prev parent 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 GNAT Stream Read processing problem Bruce Detter
1999-01-05 0:00 ` Tom Moran [this message]
1999-01-05 0:00 ` Bruce Detter
1999-01-06 0:00 ` dewar
1999-01-06 0:00 ` Elaborate compile-time error messages (was: GNAT Stream Read ...) Larry Kilgallen
1999-01-06 0:00 ` Marin David Condic
1999-01-11 0:00 ` Georg Bauhaus
1999-01-13 0:00 ` Simon Wright
1999-01-06 0:00 ` bourguet
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
1999-01-06 0:00 ` Matthew Heaney
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox