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 Path: g2news1.google.com!postnews.google.com!e38g2000yqa.googlegroups.com!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: Newbie question -- dereferencing access Date: Thu, 12 Mar 2009 03:16:51 -0700 (PDT) Organization: http://groups.google.com Message-ID: <15ae052a-ce4e-4c19-922e-0704bf0b4a3f@e38g2000yqa.googlegroups.com> References: NNTP-Posting-Host: 153.98.68.197 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1236853011 29277 127.0.0.1 (12 Mar 2009 10:16:51 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 12 Mar 2009 10:16:51 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: e38g2000yqa.googlegroups.com; posting-host=153.98.68.197; posting-account=pcLQNgkAAAD9TrXkhkIgiY6-MDtJjIlC User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.7) Gecko/2009021910 Firefox/3.0.7,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:4061 Date: 2009-03-12T03:16:51-07:00 List-Id: On Mar 12, 10:57=A0am, Tim Rowe wrote: > Ludovic Brenta wrote: > > On Mar 11, 9:26 pm, Tim Rowe wrote: > >> If I have an access variable, for example: > >> =A0 =A0 =A0s: access string :=3D 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! > > > =A0 =A0Copy_Of_S : String :=3D s.all; > > > This also works when passing parameters, e.g. > > > =A0 =A0procedure P (Str : in String) is null; > > begin > > =A0 =A0P (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. The Ada Programing wikibook has received a lot of praise and has a complete chapter discussing access types: http://en.wikibooks.org/wiki/Ada_Programming/Types/access See also the books and tutorials listed at http://www.adaic.com/learn/index= .html -- Ludovic Brenta.