From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-2.9 required=3.0 tests=BAYES_00,NICE_REPLY_A autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader02.eternal-september.org!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!buffer1.nntp.dca1.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Thu, 06 Jan 2022 20:41:30 -0600 Subject: Re: Ok - WHAT are those "Maps.Identity" things ??? Newsgroups: comp.lang.ada References: From: "1.AAC0832" Date: Thu, 6 Jan 2022 21:41:24 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Message-ID: X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 98.77.165.67 X-Trace: sv3-6yG4bX+PpBX/9fPcDLzQ5uU3++oJEhNS9R/s1GrtPI0Nqn4qsOGeshCR73yCWNNAK+Zm/ecq6nUM+vy!fHEn3EVVnblH+3Jwa3QVuSGCpCFHI9TXIOWJ4x8EwrzeKQyLV3A0kwDwP8ami14K5J2+bEaByAFX!YeCzBBIIbocPznYTWfQ= X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 3346 Xref: reader02.eternal-september.org comp.lang.ada:63350 List-Id: On 1/5/22 8:01 AM, Jeffrey R.Carter wrote: > On 2022-01-05 01:54, 1.AAC0831 wrote: >> >> The docs say to use Index(source,substr,,) > > I don't know what "docs" you mean. Anyone using Ada should be familiar > with its standard library, which is documented in Annex A of the ARM at > > http://www.ada-auth.org/standards/aarm12_w_tc1/html/AA-A.html > > (I provide the link to the AARM as the annotations are sometimes useful.) > > The documentation for Ada.Strings.Fixed is at > > http://www.ada-auth.org/standards/aarm12_w_tc1/html/AA-A-4-3.html > > and lists 6 functions named Index (and 2 for Index_Non_Blank). Of these > I mostly use the one at paragraph 9: > > 9  function Index (Source   : in String; >                    Pattern  : in String; >                    Going    : in Direction := Forward; >                    Mapping  : in Maps.Character_Mapping >                                 := Maps.Identity) >       return Natural; > > with the defaults for the last 2 parameters. Occasionally I've used a > Going => Backward, I'm using unbounded strings and there's a version in that library with the same params - but Gnat seems to DEMAND the last two params. Might try the fixed library by casting my unbounded to string ... Anyway, in frustration I just wrote my own. Works good and I was able to finish what I wanted to do. > The Mapping/Test parameters are for specialized needs, such as > case-insensitive matching or folding accented characters together, and > the default will work if you don't need anything like that. I've been programming since a tad before the dawn of the Apples and Commodores - punch cards and serial terminals wired to the mini-mainframe, FORTRAN, COBOL, that horrible stuff. For some reason I just can't grock a lot of the Ada docs. Lots and lots of DESCRIPTIONS about how to do things but a "picture" is worth a thousand words ... But I really really like Pascal better.