comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: Exception problem
Date: 1997/03/09
Date: 1997-03-09T00:00:00+00:00	[thread overview]
Message-ID: <dewar.857943261@merv> (raw)
In-Reply-To: JohnVolan-0903971008050001@accs-as34-dp04.snfc.grid.net


John Volan said

<<    Get (Text, Length);
    Get (From => Text (1 .. Length), -- eats any leading whitespace
         Item => Your_Integer,
         Last => Next); -- stops at the end of the integer literal,
                        -- before any trailing whitespace (or indeed,
                        -- any trailing anything
    -- optionally, if you want to do something with the rest of the input line,
    -- you can do:>>

Beware of this approach, it is a little too forgiving. For example, if
you read in 16.23 as an integer, it will work fine, reading 16, and stopping
at the period. You can of course check this, but I have seen several bug
reports from people who get trapped by this and expect data error, and
do not get it!





  reply	other threads:[~1997-03-09  0:00 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-02-18  0:00 Exception problem Larry Coon
1997-02-18  0:00 ` Michael Feldman
1997-02-19  0:00   ` Larry Coon
1997-02-19  0:00 ` Keith Allan Shillington
1997-02-19  0:00 ` Joerg Rodemann
1997-02-19  0:00   ` Mats Weber
1997-02-19  0:00 ` David C. Hoos, Sr.
1997-02-19  0:00   ` Robert Dewar
1997-02-19  0:00   ` Larry Coon
1997-02-22  0:00 ` Arthur Evans Jr
1997-02-24  0:00   ` Larry Coon
1997-02-24  0:00     ` Larry Kilgallen
1997-02-24  0:00       ` Larry Coon
1997-02-25  0:00         ` Fergus Henderson
1997-02-25  0:00     ` Do-While Jones
1997-03-09  0:00       ` John Volan
1997-03-09  0:00         ` Robert Dewar [this message]
1997-03-12  0:00         ` Keith Thompson
1997-02-25  0:00   ` Robert I. Eachus
replies disabled

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