comp.lang.ada
 help / color / mirror / Atom feed
From: mcslemon@hotmail.com (mcslemon)
Subject: Exit using Return Key
Date: 5 Jan 2004 15:39:02 -0800
Date: 2004-01-05T15:39:02-08:00	[thread overview]
Message-ID: <adec5a4d.0401051539.2700d6f6@posting.google.com> (raw)

Help!

Doing an assignment and have nearly finished, but have come to a
problem!

I'm using get(conv) to read input from the keyboard....this is fine,
but CONV is assigned to a type, so can't vary from the type.

The person can either enter a phrase to continue, or hit enter to exit
the program.

Is there a way of reading the line length or something so if they type
the phrase it continues or exits on return key hit.

Starts using:

  type Measurement is (Ins,Mil,Cm,Km,Lbs,Kg);
  package measurement_inout is new enumeration_io(measurement);
  subtype Distance is Measurement range Ins..Km;
  subtype Weight is Measurement range Lbs..Kg;
  use measurement_inout;
  Conv : Measurement;
..

..

..

loop
     New_Line;

       Put("Please Enter Unit to Convert From");
        New_Line;

        Get(Conv);

reads the CONV there...

Any ideas!

Neil.



             reply	other threads:[~2004-01-05 23:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-05 23:39 mcslemon [this message]
2004-01-06  0:04 ` Exit using Return Key Stephen Leake
replies disabled

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