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-Language: ENGLISH,ASCII X-Google-Thread: 103376,789b3fa522bdcc2a X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-04-04 02:20:02 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed1.bredband.com!bredband!newsfeed1.telenordia.se!algonet!uab.ericsson.se!erinews.ericsson.se!news.ericsson.se!not-for-mail From: Frode Tenneboe Newsgroups: comp.lang.ada Subject: Re: Optimising string handling in application Date: Fri, 4 Apr 2003 10:13:41 +0000 (UTC) Organization: Ericsson AS Message-ID: <1049451208.932382@edh3> References: <1049267738.39983@edh3> NNTP-Posting-Host: edh3.edh.ericsson.se Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: newstree.wise.edt.ericsson.se 1049451221 22537 193.180.212.12 (4 Apr 2003 10:13:41 GMT) X-Complaints-To: abuse@ericsson.se NNTP-Posting-Date: Fri, 4 Apr 2003 10:13:41 +0000 (UTC) User-Agent: tin/1.4.1-19991201 ("Polish") (UNIX) (SunOS/5.8 (sun4u)) Cache-Post-Path: edh3!unknown@alne X-Cache: nntpcache 2.3.3 (see http://www.nntpcache.org/) Xref: archiver1.google.com comp.lang.ada:35918 Date: 2003-04-04T10:13:41+00:00 List-Id: tmoran@acm.org wrote: > You don't need the temporary (Dummy) string. Just calculate the > length first, > Msg_Length := Msg_Length > - (Start_Next_String-Stop_First_String-1) > + Callsign_Length; > then set Msg(1 .. Msg_Length) to the concatenation. Well, yes. Except that you now have overwritten the length of the orignal string, but that's easily fixed. Thanks. However, sometimes I miss the expressionness of perl: s/([^;]*;ME001=)([^;]*)(;[^;]*)/$1$callsign$3/; ;-) > Ah, so your abstract type is not "String", but rather a home-grown > version of Bounded_String that passes the current length as a separate > variable. Let me guess where this code originated... :) -Frode -- ^ Frode Tenneb� | email: Frode.Tennebo@eto.ericsson.se ^ | Ericsson AS., N-1788 Halden | Phone: +47 67 25 09 39 | | with Standard.Disclaimer; use Standard.Disclaimer; |