comp.lang.ada
 help / color / mirror / Atom feed
From: "Clueless" <chris@dont.spam.me>
Subject: Re: Pool Specific Access Types? Thanks Ted...everyone.
Date: Thu, 06 Sep 2001 22:24:23 GMT
Date: 2001-09-06T22:24:23+00:00	[thread overview]
Message-ID: <rISl7.85929$K6.35200808@news2> (raw)
In-Reply-To: 3B9797BF.B6FEA4A@worldnet.att.net

It finally works. Ted pointed out that I had my if/else backwards. 

Heres the code...does exactly what I'm expecting now. The Pool fills up
quite nicely...

-- 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(s'first..len) /= quit then
			anthr_numb := Integer'value(s(1..len)); N := new
			Numb_holder'(anthr_numb, N); New_Line;
		else
			N := N.Next;
			
			while N /= null loop
					
			   Put_Line( N.Number'img ); N := N.Next;	   
										
			end loop;										
		end if;
		
	end loop;

end Point_pract;

Now I can go over to a real program, and put this to use.

Thanks for your patience.

Clueless.

chris@dont.spam.me



  parent reply	other threads:[~2001-09-06 22:24 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-06 14:12 Pool Specific Access Types? Mr.Clueless
2001-09-06 15:07 ` Ted Dennison
2001-09-06 15:36   ` Mr.Clueless
2001-09-06 15:35 ` James Rogers
2001-09-06 15:54   ` Mr.Clueless
2001-09-06 17:04     ` James Rogers
2001-09-06 20:56       ` Wannabe h4x0r
2001-09-06 21:47         ` Ted Dennison
2001-09-06 22:50         ` Jeffrey Carter
2001-09-06 21:06       ` Pool Specific Access Types? Screw up in the previous post Clueless
2001-09-06 17:06     ` Pool Specific Access Types? Stephen Leake
2001-09-06 22:24   ` Clueless [this message]
2001-09-06 16:55 ` Darren New
2001-09-06 17:03   ` Ted Dennison
2001-09-06 17:19     ` Warren W. Gay VE3WWG
2001-09-06 18:55     ` Darren New
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox