comp.lang.ada
 help / color / mirror / Atom feed
From: Larry Hazel <lhhazel@otelco.net>
Subject: Re: A very strange problem indeed...
Date: Mon, 18 Mar 2002 09:22:00 -0600
Date: 2002-03-18T09:22:00-06:00	[thread overview]
Message-ID: <3C960618.1C06E64F@otelco.net> (raw)
In-Reply-To: 3c95f466$0$6552@motown.iinet.net.au

Karl-Johan Karlsson wrote:
> 
> Note that the following code details below are to do with the same
> program mentioned in the "if statement" thread involving a problem
> Steve Doiel helped me with (thanks a lot Steve!).
> 
> The problem this time is that the string for the name entry is not
> working properly!  If I have Name : String(1..20) it will only
> accept 20 characters and nothing less.  If I delete four lines
> of the code (found below to do with size and amount) then the
> string accepts any amount of characters 20 or less in amount.
> 
>    Name : String(1..20);
>    Name_Count : Natural;
> 
> I have cut the program up into little tiny bits and I've discovered
> that the following four lines of code which preceed the Name code
> is why my Name string isn't working:
> 
>    Put("size you want: ");
>    Item_Type_IO.Get(Choice);
>    Put("amount you want: ");
>    Get(Item_Amount);
> 
> (These four lines do exactly what is required of them except that they
>  seem to be effecting the Name code...)
> 
> These four lines above are the ones which are making my name string accept
> only a certain amount of characters (e.g. 20), so if I type less characters
> it will not go to the next part of the program.
> 
>    Put("Please tell us");
>    New_Line;
>    Put("your name: ");
>    Get_Line(Name, Name_Count);
> 
> The Name code above works only when I delete the size and amount code.
> So the four lines to do with the size and amount code are the problem,
> yet I cannot for the life of me understand why.  Please, any assistance
> would be greatly appreciated!
> 
> (Note that I need the name code to be just above the amount and item code!)
> 
Not sure I understand the problem, but if the code is in the order above, you
need a Skip_Line call after the Get(Item_Amount), since the Get will not consume
an end_of_line.

Larry



  reply	other threads:[~2002-03-18 15:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-18 14:06 A very strange problem indeed Karl-Johan Karlsson
2002-03-18 15:22 ` Larry Hazel [this message]
2002-03-18 16:39 ` John McCabe
2002-03-18 18:03 ` Jacob Sparre Andersen
2002-03-19  3:10 ` Karl-Johan Karlsson
replies disabled

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