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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,60118c65070501a2 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-09-06 08:35:09 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!howland.erols.net!news-out.worldnet.att.net.MISMATCH!wn3feed!worldnet.att.net!135.173.83.71!wnfilter1!worldnet-localpost!bgtnsc06-news.ops.worldnet.att.net.POSTED!not-for-mail Message-ID: <3B9797BF.B6FEA4A@worldnet.att.net> From: James Rogers X-Mailer: Mozilla 4.76 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Pool Specific Access Types? References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Thu, 06 Sep 2001 15:35:09 GMT NNTP-Posting-Host: 12.86.35.109 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc06-news.ops.worldnet.att.net 999790509 12.86.35.109 (Thu, 06 Sep 2001 15:35:09 GMT) NNTP-Posting-Date: Thu, 06 Sep 2001 15:35:09 GMT Organization: AT&T Worldnet Xref: archiver1.google.com comp.lang.ada:12807 Date: 2001-09-06T15:35:09+00:00 List-Id: Could the problem be that your record is defined with two fields: The_Numb and Next, while your loop is accessing two fields: Value and Next? You also have your access type defined as Numb_pnt while your Next field is defined as being type Numb_pt. I suspect these are typos in your posting and not in your code. It would be easier to diagnose the problem without such errors. Jim Rogers Colorado Springs, Colorado USA "Mr.Clueless" wrote: > > Alright...I'm creating an access type like this... > > type Number; > > type Numb_pnt is access Number; > > type Number is > record > The_Numb: Integer; > Next: Numb_pt; > end record; > > N: Numb_pnt; > > Now I know I got that part right...but I'm running into a problem in > reading and assigning numbers (or any other kind of data) from/to the > linked list. > > For example, I'll assign a new value from a variable like this... > > N := new Number'(, N); > > which seems to work alright. But then when I try to read from it using a > procedure such as... > > function Sum(List: Cell_Ptr) return Integer is > Local: Cell_Ptr := List; S: Integer := 0; > begin > while Local /= null loop > S := S + Local.Value; Local := Local.Next; > end loop; > return S; > end Sum; > > I get an error in s-valuns at line 85. Note I'm using the above code > segment that I found in the Barnes book. This is a Constraint Error that > pops up at runtime and terminates the program. I suspect I'm not passing > data to or reading data from the List correctly, but I'm following the > examples in the book by wrote. > > Any advice would help. Note, I am using Ada.Text_IO so as to pull the > Integers in off a text string entered by the user at runtime. > > Thanks. > > Clueless. > chris@dont.spam.me