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=-0.9 required=3.0 tests=BAYES_00,FROM_ADDR_WS autolearn=no autolearn_force=no version=3.4.5-pre1 Date: 22 Sep 92 19:06:32 GMT From: pa.dec.com!nntpd2.cxo.dec.com!bonmot!wallace@decwrl.dec.com (Richard Wal lace) Subject: ADA Max Array Size HELP!!!! Message-ID: <1992Sep22.190632.7116@nntpd2.cxo.dec.com> List-Id: mgeorgy@vmsclst1.sc.csupomona.edu writes: : I am having trouble figuring out how array sizes are determined, or should I : say what the largest size possible if??? I know that this involves the amoun t : of memory the computer has, but how, is it measured by INTEGER'LAST, and if s o : how does this figure into a multi-dimentional Array, or Matrix. : : Basicaly this is what I am trying to do: : type TEST is array (1..512, 1..512) of TYPE; : but it won't let me, why not??? : : Thanx, : Matt Georgy Matt, Given the code fragment above, the TYPE conflicts with the reserved word "type" in the Ada'83 LRM. To try and answer what I think is your real question (my rewrite), "How much memory will my declaration consume?" for example: with TEXT_IO; procedure FOO is package MY_INT_IO is new TEXT_IO.INTEGER_IO(INTEGER); use MY_INT_IO; 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; 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. To figure out the storage requirements look in package SYSTEM for your run-time system. This will list the information you need. For types of FLOAT, "digits" and record types (exception of variants) all you need do is figure out your systems storage elements and then do simple math to construct the storage space requied. Remember that storage is usually not assigned until an object of that type is declared. For variant records, this is a *rule of thumb* and not an absolute, the largest variant is the unit storage size for that record. Knowing that size, then the rest is as above. Hope this helps! Richard Wallace Digital Equipment Corporation 301 Rockrimmon Blvd. South CXO2-1/7A Colorado Springs, CO 80919-2398 (719)548-2792 "The opinions expressed are my own, Unlce Ken or Uncle Bob may, or may not, agree with me.