From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00,MSGID_SHORT autolearn=no autolearn_force=no version=3.4.5-pre1 Date: 23 Sep 92 19:36:09 GMT From: ub!dsinc!pitt.edu!gvls1!aviary!dmarshal@rutgers.edu (Dave Marshall) Subject: Re: ADA Max Array Size HELP!!!! Message-ID: <1746@aviary.Stars.Reston.Unisys.COM> List-Id: > 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