comp.lang.ada
 help / color / mirror / Atom feed
From: johnherro@aol.com (John Herro)
Subject: Re: Why won't this work
Date: 1998/02/03
Date: 1998-02-03T00:00:00+00:00	[thread overview]
Message-ID: <19980203134700.IAA29491@ladder02.news.aol.com> (raw)
In-Reply-To: Pine.OSF.3.95.980202204013.6847B-100000@esus.cs.montana.edu


SiliconJesus <softichj@cs.montana.edu> writes:
>--I want this to kill if the user enters 4 oh's- ...
>WHILE Ide /= "OOOO" LOOP ...
>      Ada.Text_IO.PUT(Item =>"Please enter the Article Id");           >     
>      Ada.Text_IO.Get_Line(Item =>Ide, Last =>how_long); 

You're comparing "OOOO" with the whole string Ide instead of just the portion
of the string that the user typed.  Change the WHILE to

WHILE Ide(1 .. how_long) /= "OOOO" LOOP

and make sure how_long is initialized before the first pass through the loop
(perhaps by setting it to 0 in its declaration).
- John Herro
Download the Ada Tutor program at:
http://members.aol.com/AdaTutor
ftp://members.aol.com/AdaTutor




      reply	other threads:[~1998-02-03  0:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-02-02  0:00 Why wont this work SiliconJesus
1998-02-03  0:00 ` John Herro [this message]
replies disabled

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