comp.lang.ada
 help / color / mirror / Atom feed
* "Xx'Address" problem
@ 2002-09-02  6:27 Darren
  2002-09-03 14:05 ` Stephen Leake
  0 siblings, 1 reply; 2+ messages in thread
From: Darren @ 2002-09-02  6:27 UTC (permalink / raw)


Hi,

I have some problems using the 'Address on some objects.

My code looks like this.

In a file I have two objects declared:

Memory         : Memory_Type;              -- Just an Array of Unsigned_16,
(index Unsigned_16)
Special_Mem : Special_Memory_Type  -- A record type consisting of several
Array types, (index Unsigned_16)

Later in my code in a procedure I try to use the same Address for
Special_Memory as for Memory using the 'Address.

This is what happens:

procedure X is


begin
    Get_Offset(Offset );
    declare
    Local_Copy_Mem : Memory_Type;

        1) for Local_Copy_Memory'Address use Memory'Address; -- Works fine
        2) for Local_Copy_Memory'Address use Special_Memory'Address; --
Works fine
        3) for Local_Copy_Memory'Address use
Special_Memory.Array_1(Offset)'Address; -- Doesn't work at all...
    begin
    end; --declare
end X;

Number 3 doesn't work, it compiles but when I debug it it seems like the
program gets stuck at that row.

What could possibly be wrong?

Any suggestions are appreciated.

/S





^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: "Xx'Address" problem
  2002-09-02  6:27 "Xx'Address" problem Darren
@ 2002-09-03 14:05 ` Stephen Leake
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Leake @ 2002-09-03 14:05 UTC (permalink / raw)


"Darren" <sebastian.madunic@avionics.saab.se> writes:

> Hi,
> 
> I have some problems using the 'Address on some objects.
> 
> My code looks like this.

Please post compilable code. 

Also, explain why you want to do this; there may be other ways in Ada
to accomplish the same thing.


-- 
-- Stephe



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-09-03 14:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-02  6:27 "Xx'Address" problem Darren
2002-09-03 14:05 ` Stephen Leake

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