From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,12283be683f6446b X-Google-Attributes: gid103376,public From: "Bruce Detter" Subject: Re: GNAT Stream Read processing problem Date: 1999/01/05 Message-ID: <76u72q$s0o6@svlss.lmms.lmco.com>#1/1 X-Deja-AN: 429200467 References: <76tsgd$s0o1@svlss.lmms.lmco.com> <36928385.8520314@news.pacbell.net> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Organization: Lockheed Martin Corporation Newsgroups: comp.lang.ada Date: 1999-01-05T00:00:00+00:00 List-Id: Thanks Tom, That did the trick. It just didn't occur to me that I was dealing with an Indexing problem. So much to learn, so little time... Thanks again... BCD3 Tom Moran wrote in message <36928385.8520314@news.pacbell.net>... >>... 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).