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: tmoran@bix.com (Tom Moran) Subject: Re: GNAT Stream Read processing problem Date: 1999/01/05 Message-ID: <36928385.8520314@news.pacbell.net>#1/1 X-Deja-AN: 429160217 References: <76tsgd$s0o1@svlss.lmms.lmco.com> X-Complaints-To: abuse@pacbell.net X-Trace: typhoon-sf.snfc21.pbi.net 915572338 206.170.2.194 (Tue, 05 Jan 1999 13:38:58 PDT) Organization: SBC Internet Services NNTP-Posting-Date: Tue, 05 Jan 1999 13:38:58 PDT Newsgroups: comp.lang.ada Date: 1999-01-05T00:00:00+00:00 List-Id: >... 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).