comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen_leake@acm.org>
To: comp.lang.ada@ada-france.org
Subject: Re: Strings as Parameters
Date: 04 Oct 2004 21:21:24 -0400
Date: 2004-10-04T21:21:24-04:00	[thread overview]
Message-ID: <mailman.186.1096939296.390.comp.lang.ada@ada-france.org> (raw)
In-Reply-To: <cjslbv$tb4$01$1@news.t-online.com>

"Rick Santa-Cruz" <rick_santa_cruz75@msn.com> writes:

> Hi,
> 
> I really have a super easy question:
> 
> If in a subprogram I wanna use a variable of type String then I always have 
> to specify, how long this String will be... for example the following way:
> procedure Main is
>     S: String(1..10);
> begin
> ...
> end Main;
> 
> But if I use a String as a Parameter of a function or procedure I don't have 
> to specify the range. That means I can just write a procedure like this:
> 
> procedure Test_It(S: String) is
> begin
> ...
> end Test_It;
> 
> What is the technical detail behind this? 

It's an example of an unconstrained array. The bounds of the array
('first and 'last) are passed with the array.

> And why is such possible?

VAX/VMS did it back in the 1970's; it's not hard :).

-- 
-- Stephe




      parent reply	other threads:[~2004-10-05  1:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-04 23:11 Strings as Parameters Rick Santa-Cruz
2004-10-05  0:20 ` Matthew Heaney
2004-10-05  0:41 ` Jeffrey Carter
2004-10-05  1:21 ` Stephen Leake [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