by "jimmaureenrogers@[EMAIL PROTECTED]
" <jimmaureenrogers@[EMAIL PROTECTED]
Mar 30, 2008 at 02:28 PM
On Mar 30, 3:08 pm, jedivaughn <jedivaugh...@[EMAIL PROTECTED]
> wrote:
> number 1 thank you so much for the fast response. But when I try your
> suggestion and use say "1234" for the input I get the number 1, a few
> spaces, and then some smiley faces. not exactly what I was hoping
> for :) . Here's my code if that's any help.
>
> with ada.text_IO, ada.integer_text_IO;
>
> procedure integers is
>
> index : natural :=0;
> char : character;
> str : string (1..10);
>
> begin
>
> ada.text_IO.put("Please enter a few Integers ");
> ada.text_IO.get(char);
>
> Index := Index + 1;
> Str(Index) := Char;
> ada.text_IO.put(str);
>
> end integers;
Your example contains no loop, so it only gets a single character.
Ada strings are not null terminated like C strings. They are fixed
length data items.
A proper output of the character you collected is
Ada.Text_IO.Put(Str(1..Index));
Jim Rogers