comp.lang.ada
 help / color / mirror / Atom feed
From: AdaMagica <christ-usch.grein@t-online.de>
Subject: Re: Question: Ordered Loading of an Array.
Date: Sat, 4 Feb 2017 04:41:04 -0800 (PST)
Date: 2017-02-04T04:41:04-08:00	[thread overview]
Message-ID: <af359865-6ff7-4995-9739-13d5e50a7a0b@googlegroups.com> (raw)
In-Reply-To: <0fa9d98c-891f-4d18-b1ac-e6274d97dcfa@googlegroups.com>

Am Samstag, 4. Februar 2017 10:55:29 UTC+1 schrieb Austin Obyrne:

Not mentioning typos.

> This_Num : Integer;  -- Why isn't this of subtype Index_1?

> 
> SUBTYPE Index_1 IS Integer RANGE 32 .. 126;
> TYPE This_NumArray IS ARRAY(Index)_1 OF Integer;
> Cell_Num : This_NumArray:= (others =>0);
> 
> Input Program:
> 
> For I in  1 .. 95 Loop ;
> Ada.Text_IO. Put(Item => "Please enter any integer in the range 32 to 126");
No range check here! Why?

> Ada.Integer_Text_IO.Get (Item => This_Num);
> Cell_Num := This_Num;  -- What's this line?

> Cell_Num(This_Num) := Cell_Num(This_Num) +1;


  reply	other threads:[~2017-02-04 12:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-04  9:55 Question: Ordered Loading of an Array Austin Obyrne
2017-02-04 12:41 ` AdaMagica [this message]
2017-02-04 15:34   ` Austin Obyrne
2017-02-04 16:22   ` Rich
replies disabled

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