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 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!news3.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local1.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Wed, 22 Dec 2004 13:34:08 -0600 From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Passing arrays to procedures References: X-Newsreader: Tom's custom newsreader Message-ID: Date: Wed, 22 Dec 2004 13:34:09 -0600 NNTP-Posting-Host: 67.161.24.234 X-Trace: sv3-PHIoVbGTftCuI8Gb6S1BevsMLejNO70wCpwl73C9RVmeBcFn86O/z0U003N8dHTr+wvrr5DLVci0OxZ!PKApNahmscMqHoyiknSP/TLEh8jfNSCRyrAVErpnH0K5qEK6o6U6pMxdjBSzEw== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.22 Xref: g2news1.google.com comp.lang.ada:7182 Date: 2004-12-22T13:34:09-06:00 List-Id: > in the seperate procedure-file, because there is no way to declare sth >before the procedure starts. You need to put the array and procedure declarations together in a public package, eg package Processing is type Blah is array (Integer range <>) of ... procedure Procname (N : in Integer; v1 : in Blah); end Processing; and then the (private) body of the callee goes in the package body: package body Processing is procedure Procname (N : in Integer; v1 : in Blah) is ... end Procname; end Processing; Then the caller will look something like with Processing; procedure Main is X : Processing.Blah(1 .. 10); begin Processing.Procname(17, X); -- or Processing.Procname(N=>17, v1=>X); >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 The Ada language is not defined in terms of files, but rather in terms of (separately compilable) "compilation units" - eg packages, library level procedures, and some other stuff. Some compilers (eg, GNAT) impose a restriction that a single file can contain only a single compilation unit. I'm guessing you're using GNAT and that's why you get that error message.