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-7-bit X-Google-Thread: 103376,1f8b4cce7e72b123 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-25 23:14:33 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newshub2.rdc1.sfba.home.com!news.home.com!news1.rdc1.sfba.home.com.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Arrays and Access types... References: <20011025214647.2788a60b.egm2@jps.net> X-Newsreader: Tom's custom newsreader Message-ID: <9b7C7.72630$gT6.36973495@news1.rdc1.sfba.home.com> Date: Fri, 26 Oct 2001 06:14:29 GMT NNTP-Posting-Host: 24.7.82.199 X-Complaints-To: abuse@home.net X-Trace: news1.rdc1.sfba.home.com 1004076869 24.7.82.199 (Thu, 25 Oct 2001 23:14:29 PDT) NNTP-Posting-Date: Thu, 25 Oct 2001 23:14:29 PDT Organization: Excite@Home - The Leader in Broadband http://home.com/faster Xref: archiver1.google.com comp.lang.ada:15215 Date: 2001-10-26T06:14:29+00:00 List-Id: >left, right, start : My_Array_Ref; > ... > left := start(start'first .. 100); -- that doesn't work! "left" is not an array, so you can't assign an array to it - it's an access type. I presume you don't want to create a new string with an initial value that is a copy of start(start'first .. 100), but you want "left" to rename the leftmost part of "start", and you would prefer to do this without access values. start : string(1 .. 200); -- or whatever first_blank:natural; left : string renames start(start'first .. 100); begin first_blank := ada.strings.fixed.index(left, " "); -- assume > 1 declare leftmost_word : string renames left(left'first .. first_blank-1); begin ... If you need to divide it into N substrings, where N is not known at compile time, you'll want a loop or a recursive procedure, of course.