comp.lang.ada
 help / color / mirror / Atom feed
From: tmoran@acm.org
Subject: Re: Newbie question on Ada TExt_IO
Date: Fri, 04 Oct 2002 18:13:56 GMT
Date: 2002-10-04T18:13:56+00:00	[thread overview]
Message-ID: <ETkn9.41681$PP.45725@rwcrnsc53> (raw)
In-Reply-To: Sikn9.1513$Mw4.1034@nwrddc01.gnilink.net

>expecting a character not a single item String array!  How can I convert
>from one into the other?
  A String is an array of Character so you just subscript to get a
single value.  String(1 .. 2) is a 2 character string, String(1 .. 1)
is a 1 character long string, and String(1) is a single Character.
So replace
>        if Is_Digit(Input(1..1)) then
which is illegal, by
         if Is_Digit(Input(1)) then
or, more simply,
         if Input(1) in '0' .. '9' then

Note that there's a bug in your code: what happens if the user just
hits the Enter key without having typed in any characters for Input?

You might consider dropping the Success flag and instead using an
"exit" statement.

>Does the RM list all the packages provided by Ada or are there more to be
>discovered?
  Particular compiler vendors usually supply extra stuff, and you can find
things at www.adaic.org or www.adapower.com, but yes, the RM lists all
the *official* Ada packages.



  parent reply	other threads:[~2002-10-04 18:13 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-03 18:20 Newbie question on Ada TExt_IO Justin
2002-10-03 18:50 ` Matthew Heaney
2002-10-03 19:05 ` Jeffrey Carter
2002-10-03 19:35 ` David C. Hoos
2002-10-03 19:35 ` tmoran
2002-10-03 19:43 ` Preben Randhol
2002-10-03 19:55   ` Matthew Heaney
2002-10-03 20:07     ` Preben Randhol
2002-10-04  2:42 ` SteveD
2002-10-04 17:49   ` Justin Birtwell
2002-10-04 18:00     ` David C. Hoos
2002-10-04 18:04       ` Preben Randhol
2002-10-04 18:00     ` Preben Randhol
2002-10-04 18:02       ` Preben Randhol
2002-10-04 18:34     ` tmoran
2002-10-04 17:34 ` Justin Birtwell
2002-10-04 17:58   ` Preben Randhol
2002-10-04 18:13   ` tmoran [this message]
2002-10-04 20:07   ` Jeffrey Carter
2002-10-07  8:26     ` Fraser Wilson
2002-10-07 19:44       ` Jeffrey Carter
2002-10-05  2:43   ` SteveD
2002-10-05  5:25     ` tmoran
  -- strict thread matches above, loose matches on Subject: below --
2002-10-07  6:01 Grein, Christoph
2002-10-07  8:27 Grein, Christoph
2002-10-07 11:48 ` Fraser Wilson
2002-10-07 12:46   ` Robert A Duff
replies disabled

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