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,691bbbf0ab0cc67e X-Google-Attributes: gid103376,public From: jsa@alexandria (Jon S Anthony) Subject: Re: [Q] Returning Strings From A Function Date: 1997/04/07 Message-ID: #1/1 X-Deja-AN: 231366696 Distribution: world References: <33474626.4BA3@us.net> Organization: PSI Public Usenet Link Newsgroups: comp.lang.ada Date: 1997-04-07T00:00:00+00:00 List-Id: In article <19970407112901.HAA07881@ladder01.news.aol.com> johnherro@aol.com writes: > I wrote: > >> Target(1 .. Source'Length) := Source; > > Mark & Zurima McKinney wrote: > > maybe Target(Target'First .. Target'First + Source'Length -1); > > Absolutely! I've often warned my students not to assume that the > index of a string starts at 1, and even have that warning in my Ada > Tutor program. Then in my haste I made that error myself in the > above posting! IMO, the simplest way of getting at the (Target'First .. Target'First + Source'Length -1 business is to write: Target(Source'Range) := Source; Of course this may not be what you are after since the slice represented here may not be the one you really want... /Jon -- Jon Anthony Organon Motives, Inc. Belmont, MA 02178 617.484.3383 jsa@organon.com