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,b34ecb04700058dd X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-17 00:40:16 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: maa@liacc.up.pt (=?ISO-8859-1?Q?M=E1rio_Amado_Alves?=) Newsgroups: comp.lang.ada Subject: Re: how to parse words from a string Date: 17 Nov 2002 00:40:16 -0800 Organization: http://groups.google.com/ Message-ID: <4a4de33a.0211170040.1b8de118@posting.google.com> References: <3DD3EF12.3010009@acm.org> NNTP-Posting-Host: 195.23.52.96 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1037522416 9113 127.0.0.1 (17 Nov 2002 08:40:16 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 17 Nov 2002 08:40:16 GMT Xref: archiver1.google.com comp.lang.ada:30994 Date: 2002-11-17T08:40:16+00:00 List-Id: > Another approach is to parse the words as you read the file; for an > example, see PragmARC.Word_Input from the PragmAda Reusable Components > > http://home.earthlink.net/~jrcarter010/pragmarc.htm Or simply write: C : Character Word : Unbounded_String; begin loop Get_Immediate (C); if Is_Graphic (C) and C /= ' ' then Append (Word, C); else Process (Word); Word := Null_Unbounded_String; end if; end loop; exception when End_Error => if Word /= Null_Unbounded_String then Process (Word); end if; as was recently posted on thread "parse word from a string" ;-) --MAA