comp.lang.ada
 help / color / mirror / Atom feed
From: ub!dsinc!pitt.edu!gvls1!aviary!dmarshal@rutgers.edu  (Dave Marshall)
Subject: Re: ADA Max Array Size HELP!!!!
Date: 23 Sep 92 19:36:09 GMT	[thread overview]
Message-ID: <1746@aviary.Stars.Reston.Unisys.COM> (raw)

> with TEXT_IO;
> procedure FOO is
> 
>    package MY_INT_IO is new TEXT_IO.INTEGER_IO(INTEGER); use MY_INT_IO;

     The above instantiation is unnecessary.  See below.
> 
>    type TEST is array(1..512,1..512) of INTEGER;
> 
>    BAR : TEST;
> 
> begin
> 
>    MY_INT_IO.PUT( INTEGER ( BAR'size / 8) ); TEXT_IO.NEW_LINE;

                    ^^^^^^^

This cast is unnecessary, BTW.  'SIZE is of type universal-integer, which
any compiler will gladly convert to whatever integer type you need it for.

Try instead:

     TEXT_IO.PUT_LINE( INTEGER'IMAGE ( BAR'SIZE / 8));
> 
> end FOO;
> 
> When run, the answer of 1048576 is given (for a VAX/VMS) system because
> an INTEGER type is 4 bytes and a byte on this machine is 8 bits.
> 

Same result on a Sun.

Here's a question for the Verdix gurus:

When I try the above program, I get a storage error exception.  When I modify
it slightly to dynamically allocate the array object, no problem.  What do
I need to do to get the above program without resorting to access types?
-- 
                                           Dave Marshall
                                           dmarshal@stars.reston.unisys.com

             reply	other threads:[~1992-09-23 19:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1992-09-23 19:36 Dave Marshall [this message]
  -- strict thread matches above, loose matches on Subject: below --
1992-09-22 19:06 ADA Max Array Size HELP!!!! pa.dec.com!nntpd2.cxo.dec.com!bonmot!wallace
replies disabled

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