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 17:20:53 +0100
Date: 2004-12-22T17:20:53+01:00	[thread overview]
Message-ID: <1167048.Xn0TX2Lvi1@linux1.krischik.com> (raw)
In-Reply-To: cqc0kt$mcn$00$1@news.t-online.com

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 can only use named subtypes as procedure parameters:

Programming:Ada:Subtypes#named_subtype

You might also want to read:

Programming:Ada:Types:array

Martin
-- 
mailto://krischik@users.sourceforge.net
http://www.ada.krischik.com



      parent reply	other threads:[~2004-12-22 16:20 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
2004-12-23  0:50     ` Jeffrey Carter
2004-12-22 16:20 ` Martin Krischik [this message]
replies disabled

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