From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,f8a66fb9d0293bf4 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Alex R. Mosteo" Newsgroups: comp.lang.ada Subject: Re: Passing arrays to procedures Date: Wed, 22 Dec 2004 16:09:44 +0100 Message-ID: <41C98E38.7000908@mailinator.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net st7arSBJM5+yPGoFQ8ICRgiV9Ypu6BUoiaNY+Lgy3uTmf5vqg= User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) X-Accept-Language: en-us, en In-Reply-To: Xref: g2news1.google.com comp.lang.ada:7164 Date: 2004-12-22T16:09:44+01:00 List-Id: xadian wrote: > Hi, > > I just wanted to pass an array to a procedure. > A procedure head like this: > > procedure procname (n : in Integer; v1 : in array;) is ... > > it causes the following error: > > anonymous array definition not allowed here. > Same for array(Integer range 1..2) of Integer. The procedure is an extra > file so there are no arraynames of the main procedure available for the > parameter part. > Anyone knows why this error occurs and how to fix it?! You must declare an array type and use it in the function declaration: type Blah is array (Integer range <>) of Something; procedure Procname (N : in Integer; v1 : in Blah) is... of course you can declare the array type where it best fit your design.