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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e5f1e38db361b33e,start X-Google-Attributes: gid103376,public From: Preben Randhol Subject: [newbie] Need som feedback on code snip Date: 1999/10/22 Message-ID: #1/1 X-Deja-AN: 539245554 X-Complaints-To: usenet@itea.ntnu.no X-Trace: kopp.stud.ntnu.no 940596568 23392 129.241.83.82 (22 Oct 1999 12:49:28 GMT) Organization: ProgramVareVerkstedet NNTP-Posting-Date: 22 Oct 1999 12:49:28 GMT Newsgroups: comp.lang.ada Date: 1999-10-22T12:49:28+00:00 List-Id: I wondered if somebody could take a peep at the code snip below and comment on it. It works, but is is the Right Way to do it or is there a smarter way. I'm learning Ada95 on my own and could need some feedback from somebody experienced with Ada. -- Just a small test to see how I can change the content of a string -- variable when I do not know the length of the new or old text. with Text_IO; use Text_IO; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; procedure myTest is Orig_Text : aliased Unbounded_String := To_Unbounded_String("Hello world!"); type String_ptr is access all Unbounded_String; Text_pointer : String_ptr; begin Put_Line(To_String(Orig_Text)); Text_Pointer := Orig_Text'Access; Text_Pointer.all := To_Unbounded_String("Hello yourself!"); Put_Line(To_String(Orig_Text)); end myTest; Thanks in advance... -- Preben Randhol Affliction is enamoured of thy parts, [randhol@pvv.org] And thou art wedded to calamity. [http://www.pvv.org/~randhol/] -- W. Shakespeare