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 16:27:02 PST Newsgroups: comp.lang.ada Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp.abs.net!uunet!dca.uu.net!ash.uu.net!xyzzy!nntp From: Jeffrey Carter Subject: Re: Pool Specific Access Types? X-Nntp-Posting-Host: e246420.msc.az.boeing.com Content-Type: text/plain; charset=us-ascii Message-ID: <3B97FDAF.3DDCD98@boeing.com> Sender: nntp@news.boeing.com (Boeing NNTP News Access) Content-Transfer-Encoding: 7bit Organization: The Boeing Company X-Accept-Language: en References: <3B9797BF.B6FEA4A@worldnet.att.net> <3B97ACBA.26FB053F@worldnet.att.net> Mime-Version: 1.0 Date: Thu, 6 Sep 2001 22:50:23 GMT X-Mailer: Mozilla 4.5 [en]C-CCK-MCD Boeing Kit (WinNT; U) Xref: archiver1.google.com comp.lang.ada:12855 Date: 2001-09-06T22:50:23+00:00 List-Id: Wannabe h4x0r wrote: > > 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 S will never be equal to Quit. S'Length is 15, and Quit'Length is 1. > while N /= null loop > > Put_Line( N.Number'img ); > N := N.Next; > exit; > end loop; This appears to be what you want to do when S = Quit. Is the test in your "if" wrong? > else > anthr_numb := Integer'value(s(1..len)); This is what you do if S = Quit, which is never true. However, if it were true, this call to Integer'Value would raise an exception, since S (S'First .. Len) does not contain the textual representation of an Integer. > N := new Numb_holder'(anthr_numb, N); > > New_Line; > > > end if; > end loop; > > end Point_pract; -- Jeffrey Carter