From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c0d4e990924eb044 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.posted.plusnet!news.posted.plusnet.POSTED!not-for-mail NNTP-Posting-Date: Thu, 12 Mar 2009 04:57:10 -0500 Date: Thu, 12 Mar 2009 09:57:08 +0000 From: Tim Rowe User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Newbie question -- dereferencing access References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-Ranfdv7ok1JbwhMRwFio29TucbrSX0pZSLmNVt3F0cpIhrPE4EJOfUC4jE+bFzx+nGA9N5w/yr8LOlq!Xe40zGno+SlyFHxAingl4a7TTb9GRCNil6Outnmx9wUPKRBLwBZ8LT5NsnJpx8G2lCqXZP/yAFLB!7zd7P7oXKUeU X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.39 Xref: g2news2.google.com comp.lang.ada:5030 Date: 2009-03-12T09:57:08+00:00 List-Id: Ludovic Brenta wrote: > On Mar 11, 9:26 pm, Tim Rowe wrote: >> If I have an access variable, for example: >> s: access string := new String'("Foo"); >> is there an easy way to assign from s to a string variable? Obviously I >> can't assign it directly, because access string is not string, so how do >> I convert? Everything I read says that dereferences happen >> automatically, but in this situation! > > Copy_Of_S : String := s.all; > > This also works when passing parameters, e.g. > > procedure P (Str : in String) is null; > begin > P (s.all); Perfect! Thanks. Can you (or anyone else) suggest a good book or online tutorial for an existing programmer, wanting to add Ada to his language portfolio? I have John Barnes "Programming in Ada 95", but I don't find his explanations very clear (and I couldn't find the answer to the question above), so if there's something better out there it might be worth me getting it.