comp.lang.ada
 help / color / mirror / Atom feed
From: "Alex R. Mosteo" <devnull@mailinator.com>
Subject: Re: Scope of vector
Date: Wed, 08 Feb 2006 11:59:16 +0100
Date: 2006-02-08T11:59:16+01:00	[thread overview]
Message-ID: <43E9CF04.20808@mailinator.com> (raw)
In-Reply-To: <1139390027.869164.41200@g43g2000cwa.googlegroups.com>

rashmi wrote:
> dear all
> 
> I am repeatedly looking-up from and appending to a float vector as
> shown below. I wish to lookup the new appended vector at the end of
> each loop as shown below. But the visibilty of the new appended vector
> is limited to the inner Decl-Begin-End block. So kindly help me solve
> this problem.
> 
> I get the feeling that if visibility is possible then vector size
> cannot be updated and vice versa.
> 
> 
> for ... loop
> 
> _______________
> |             |
> |    decl.    |
> |             |
>         <-------- existing Vector is defined here (LI)
> |             |
> _______________
> |             |
> |    Begin    |
> |             |
> |       <-------- Vector to be appended will be got here (LU)
> |             |
>   __________
> | |        |  |
> | |  decl. |  |
> | |    <--------- new appended Vector is defined here (LF:=LI+LU)
>   __________
> | |        |  |
> | |  Begin |  |
> | |        |  |
> | |      <------- existing Vector is to be appended here (LF)
> | |        |  |
> | |  End   |  |
> | |        |  |
>   __________
> |             |
> |        <------- How do I lookup the new appended vector here ?
 > |             |
 > |    End      |
 > _______________
 >
 > end loop;
 >

If I understand you correctly, you're attempting to reference a variable 
that is already out of scope. That's basically impossible. You should 
move your look-up inside the inner block.

declare
    LI : constant Float_Array := Some_Initializer;
begin
    declare
       LF : constant Float_Array := LI & Function_Giving_LU;
    begin
       --  Here you can use LF
    end;
    --  Here you can't use LF anymore, if you are asking that.
end;



  parent reply	other threads:[~2006-02-08 10:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-08  9:13 Scope of vector rashmi
2006-02-08  9:42 ` Martin Dowie
2006-02-08 10:59 ` Alex R. Mosteo [this message]
2006-02-08 13:28   ` Ludovic Brenta
replies disabled

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