From: Stewart <s_aitken@lineone.net>
Subject: Re: Data_Error - Where in this code?
Date: Thu, 09 Aug 2001 10:34:46 +0100
Date: 2001-08-09T10:34:46+01:00 [thread overview]
Message-ID: <qhl4nt0h39fsmt3bk8d0gc229uor49t12s@4ax.com> (raw)
In-Reply-To: 3B7139C8.36D68A1D@raytheon.com
On Wed, 08 Aug 2001 08:08:24 -0500, Mark Johnson
<mark_h_johnson@raytheon.com> wrote:
>Stewart wrote:
>
>> On Mon, 06 Aug 2001 20:47:41 +0100, Stewart <s_aitken@lineone.net>
>> wrote:
>> Hi,
>>
>And as such - Max_Size cannot be used in an expression prior to its
>initialization. The line...
> > Input : String (1 .. Max_Size);
>is such an expression. It requires the compiler to allocate "Max_Size" bytes of
>storage for the "Input" string. Let's say the Ada runtime gave you a default
>value of zero (0) for Max_Size - the statement above be equivalent to...
> > Input : String (1 .. 0);
The problem appears to have gone away when I glued fileload and menu
together. I moved the package definitions and the Max_Size : Positive;
to the main procedure definition area.
>
>Why not use...
> Max_Size : Positive := 80; -- make it longer than any expected input line
>instead. Text_IO.Get_Line will read up to 80 characters from the input line & set
>Max_Size to the number of characters read.
I tried this and the exception operated for the number I allocated to
Max_Size.
>The rest of the code is pretty user hostile, but "should work" as you expect.
> --Mark
Can I ask what you mean by user hostile?
I am using Skansholm's "Ada 95 from the beginning" as my learner's
bible.
any other advice gratefully received.
Stewart
next prev parent reply other threads:[~2001-08-09 9:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-08-06 19:47 Data_Error - Where in this code? Stewart
2001-08-07 13:53 ` Mark Johnson
2001-08-08 9:31 ` Stewart
2001-08-08 13:08 ` Mark Johnson
2001-08-09 9:34 ` Stewart [this message]
2001-08-09 13:27 ` Mark Johnson
2001-08-09 17:55 ` Stewart
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox