Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Those who do not understand Unix are condemned to reinvent it, poorly. -- Henry Spencer


devel / comp.lang.ada / Passing Range Parameters to new instance of unbounded, boxed <> array in Ada

SubjectAuthor
* Passing Range Parameters to new instance of unbounded, boxed <> arrayMace Ayres
`- Re: Passing Range Parameters to new instance of unbounded, boxed <>J-P. Rosen

1
Passing Range Parameters to new instance of unbounded, boxed <> array in Ada

<41b30ab1-9114-4bfa-baeb-94c39a4be00an@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5558&group=comp.lang.ada#5558

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:ae9:e713:: with SMTP id m19mr7776270qka.98.1626231230208;
Tue, 13 Jul 2021 19:53:50 -0700 (PDT)
X-Received: by 2002:a25:3c1:: with SMTP id 184mr10167638ybd.309.1626231230035;
Tue, 13 Jul 2021 19:53:50 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Tue, 13 Jul 2021 19:53:49 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=2601:645:c000:5e:1de:f0e2:fbc5:cae4;
posting-account=1sN4oQoAAABANGeLN5K5KDzu7t8XhLSV
NNTP-Posting-Host: 2601:645:c000:5e:1de:f0e2:fbc5:cae4
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <41b30ab1-9114-4bfa-baeb-94c39a4be00an@googlegroups.com>
Subject: Passing Range Parameters to new instance of unbounded, boxed <> array
in Ada
From: mace.ay...@icloud.com (Mace Ayres)
Injection-Date: Wed, 14 Jul 2021 02:53:50 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Mace Ayres - Wed, 14 Jul 2021 02:53 UTC

1) I declare - Type a_gear is array(index range <>) of Intgeger;

2) I want to create an instance of type a_gear
Gear : a_gear (var_strt..var_end);
————————————-
Both 1 and 2 must be declared after …. an ‘Is’ and before a ‘BEGIN’ of any code block

but I can’t code a sub program to get a user’s input for var_strt and var_end until after a BEGIN statement which too late to pass to the parameterized unbounded/Box array gear.

I am not getting the proper visibility and scope to capture user’s parameters before I declare an instance, gear, of the type a_gear, an unbounded array?

Re: Passing Range Parameters to new instance of unbounded, boxed <> array in Ada

<sclvk9$shd$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5559&group=comp.lang.ada#5559

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ros...@adalog.fr (J-P. Rosen)
Newsgroups: comp.lang.ada
Subject: Re: Passing Range Parameters to new instance of unbounded, boxed <>
array in Ada
Date: Wed, 14 Jul 2021 08:18:52 +0200
Organization: Adalog
Lines: 35
Message-ID: <sclvk9$shd$1@dont-email.me>
References: <41b30ab1-9114-4bfa-baeb-94c39a4be00an@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 14 Jul 2021 06:18:49 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="57499c2c76e5b6dcd8a053da4fa31b46";
logging-data="29229"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX182Swif7a/V2+aW3lOR1POF"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:z/UNvJRHPZQUSIp541ZQwlgwcNU=
In-Reply-To: <41b30ab1-9114-4bfa-baeb-94c39a4be00an@googlegroups.com>
Content-Language: fr
 by: J-P. Rosen - Wed, 14 Jul 2021 06:18 UTC

Le 14/07/2021 à 04:53, Mace Ayres a écrit :
> 1) I declare - Type a_gear is array(index range <>) of Intgeger;
>
> 2) I want to create an instance of type a_gear
> Gear : a_gear (var_strt..var_end);
> ————————————-
> Both 1 and 2 must be declared after …. an ‘Is’ and before a ‘BEGIN’ of any code block
>
> but I can’t code a sub program to get a user’s input for var_strt and
> var_end until after a BEGIN statement which too late to pass to the
> parameterized unbounded/Box array gear.
>
> I am not getting the proper visibility and scope to capture user’s
> parameters before I declare an instance, gear, of the type a_gear, an
> unbounded array?
>
This is a classical case for a "declare" block:

procedure Your_Proc is
begin
... get Var_Strt and Var_End here ...

declare
Gear : a_gear (var_strt..var_end);
begin
... use your variable here ...
end;
end Your_Proc;

--
J-P. Rosen
Adalog
2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
Tel: +33 1 45 29 21 52
https://www.adalog.fr

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor