comp.lang.ada
 help / color / mirror / Atom feed
From: Martin Krischik <martin@krischik.com>
Subject: Re: Passing arrays to procedures
Date: Wed, 22 Dec 2004 22:03:03 +0100
Date: 2004-12-22T22:03:03+01:00	[thread overview]
Message-ID: <2099625.5ju9K40BmE@linux1.krischik.com> (raw)
In-Reply-To: cqcf7o$kbu$03$1@news.t-online.com

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



  parent reply	other threads:[~2004-12-22 21:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-22 14:34 Passing arrays to procedures xadian
2004-12-22 15:09 ` Alex R. Mosteo
2004-12-22 18:43   ` xadian
2004-12-22 19:34     ` tmoran
2004-12-22 21:03     ` Martin Krischik [this message]
2004-12-23  0:50     ` Jeffrey Carter
2004-12-22 16:20 ` Martin Krischik
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox