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 13:56:51 PST Path: archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newshub2.rdc1.sfba.home.com!news.home.com!news2.POSTED!not-for-mail From: "Wannabe h4x0r" Subject: Re: Pool Specific Access Types? Newsgroups: comp.lang.ada References: <3B9797BF.B6FEA4A@worldnet.att.net> <3B97ACBA.26FB053F@worldnet.att.net> User-Agent: Pan/0.8.1beta4 (Unix) X-No-Productlinks: Yes Message-ID: Date: Thu, 06 Sep 2001 20:56:50 GMT NNTP-Posting-Host: 24.0.109.49 X-Complaints-To: abuse@home.net X-Trace: news2 999809810 24.0.109.49 (Thu, 06 Sep 2001 13:56:50 PDT) NNTP-Posting-Date: Thu, 06 Sep 2001 13:56:50 PDT Organization: Excite@Home - The Leader in Broadband http://home.com/faster Xref: archiver1.google.com comp.lang.ada:12842 Date: 2001-09-06T20:56:50+00:00 List-Id: In article <3B97ACBA.26FB053F@worldnet.att.net>, James Rogers wrote: > "Mr.Clueless" wrote: >> >> Your right, it is a typo. Should read... >> >> function Sum(List: Numb_ptr) return Integer is >> Local : Numb_ptr := List; S : Inter := 0; > ^^^^^ > Another transcription error >> begin >> while Local /= null loop >> S := S + Local.The_Numb; Local := Local.Next; >> end loop; return S; >> end Sum; >> >> Also, I'm not sure how accessing two fields in a loop would cause an >> error. I can possibly see issues with regards to scope, but it's a >> little fuzzy. Perhaps a nested loop, one accessing the "The_Numb" value >> and the other accessing the "Next" value would do it? > > There is nothing wrong with your logic. I must assume there is something > wrong with your syntax. > > Perhaps, if you posted some of the actual code, instead of your manual > transcriptions, we might be able to find your error. > > Jim Rogers Colorado Springs, Colorado USA Your right. Sorry. I was afraid that readers of this group really didnt like the posting of whole programs, as they can get rather lengthy. But here it is anyways. -- This is a file so I can learn how to do pointers in Ada95 -- -- Try not to laugh too much. I'm a former C junkie, and it shows. -- with Ada.Text_IO; use Ada.Text_IO; procedure Point_pract is type Numb_holder; type Numb_ptr is access Numb_holder; type Numb_holder is record Number: Integer; Next: Numb_Ptr; end record; N: Numb_ptr; s : string(1..15); len : natural; quit : constant String := "q"; anthr_numb : integer := 0; begin loop Put_Line("Enter a number here: "); Get_Line( s , len); if s /= quit then while N /= null loop Put_Line( N.Number'img ); N := N.Next; exit; end loop; else anthr_numb := Integer'value(s(1..len)); N := new Numb_holder'(anthr_numb, N); New_Line; end if; end loop; end Point_pract;