From: Stephen Leake <Stephen.A.Leake@nasa.gov>
Subject: Re: Deference question
Date: 26 Feb 2003 14:06:27 -0500
Date: 2003-02-26T19:20:21+00:00 [thread overview]
Message-ID: <usmua50b0.fsf@nasa.gov> (raw)
In-Reply-To: 1d13e1b4.0302260734.7b26fece@posting.google.com
papand0pul0@yahoo.com (Papandopulo) writes:
> Maybe simple question, but I am just starting with Ada.
>
> I try to read an array from file using streams:
>
> declare
> type X_Value is mod 2**8;
> type X_Buffer is array (Positive range <>) of X_Value;
> type X_Buffer_Access is access all X_Buffer;
> type X_Buffer_Sz is new X_Buffer (1 .. Positive(Q_Bytes));
> type X_Buffer_Sz_Access is access all X_Buffer_Sz;
> Buff : X_Buffer_Sz_Access;
> begin
> Buff := new X_Buffer_Sz;
> X_Buffer_Sz'Read (X_Stream, Buff'all);
> end;
>
> But gnat tells me:
> attribute designator expected
> on the dereference (Buff'all)
You want Buff.all, not Buff'all.
the ' means the following identifier is an "attribute", like 'Read.
But you want a dereference, which is .all
--
-- Stephe
next prev parent reply other threads:[~2003-02-26 19:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-26 15:34 Deference question Papandopulo
2003-02-26 19:06 ` Stephen Leake [this message]
2003-02-26 19:30 ` Martin Krischik
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox