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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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!news1.google.com!proxad.net!newsfeed.stueberl.de!newsfeed01.sul.t-online.de!newsmm00.sul.t-online.de!t-online.de!news.t-online.com!not-for-mail From: Martin Krischik Newsgroups: comp.lang.ada Subject: Re: Passing arrays to procedures Date: Wed, 22 Dec 2004 22:03:03 +0100 Organization: None Message-ID: <2099625.5ju9K40BmE@linux1.krischik.com> References: <41C98E38.7000908@mailinator.com> Reply-To: martin@krischik.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: news.t-online.com 1103785654 01 10449 m1BZrae6qnCqW7J 041223 07:07:34 X-Complaints-To: usenet-abuse@t-online.de X-ID: T5vKckZ-QeRRLDNDZROV0QL89XGmcw2F3V3y8rxVmwpKpQtvwx+xEi User-Agent: KNode/0.8.0 Xref: g2news1.google.com comp.lang.ada:7188 Date: 2004-12-22T22:03:03+01:00 List-Id: xadian wrote: > Alex R. Mosteo wrote: >> >> >> 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. > > Well actually I have no idea where to declare that type... > I've got two files. One with that procedure and one with the main > procedure. In the main procedure I call that other one. > The declaration can't be in the main procedure because it wont be known > in the procedure (thats what the compiler sais) and it can't be declared > in the seperate procedure-file, because there is no way to declare sth > before the procedure starts. > I already tried to declare both proedures in one file but then it sais > sth like "end of file expected" after the "end;" of the first of these > two procedures... > So where now can I declare that type?! You need a package. Sad that I have no wiki page for packages handy. But basicly: package Name is type .... end package; will do Martin -- mailto://krischik@users.sourceforge.net http://www.ada.krischik.com