comp.lang.ada
 help / color / mirror / Atom feed
From: "Matthew Heaney" <mheaney@on2.com>
Subject: Re: Newbie Q : Exception handling
Date: Fri, 30 Nov 2001 13:39:10 -0500
Date: 2001-11-30T13:39:10-05:00	[thread overview]
Message-ID: <u0fkbcsi85ntd8@corp.supernews.com> (raw)
In-Reply-To: 3C050DB2.4C327C3D@boeing.com


"Jeffrey Carter" <jeffrey.carter@boeing.com> wrote in message
news:3C050DB2.4C327C3D@boeing.com...
> Others have suggested adding Skip_Line. This will work, but I generally
> advise using Get_Line to input an entire line, then decode it Get, when
> the input comes from a human.

I agree with this advice completely.  It's too easy to forget to call
Skip_Line when there's a problem with the input, resulting in an infinite
loop.

As Jeff suggested, use Get_Line to read in the raw text, and then get the
enum value by using the version of Get that reads from a string.

This technique also allows you to pass meta-values as input, such as "first"
or "last" or "exit", etc.






  reply	other threads:[~2001-11-30 18:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-27 10:04 Newbie Q : Exception handling Stella
2001-11-28  3:13 ` DuckE
2001-11-28  3:31   ` Stella
2001-11-28 16:15 ` Jeffrey Carter
2001-11-30 18:39   ` Matthew Heaney [this message]
2001-12-12 23:40     ` Stella
  -- strict thread matches above, loose matches on Subject: below --
2001-11-28  8:36 Gautier Write-only-address
replies disabled

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