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,FREEMAIL_FROM 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-13 02:17:23 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!arclight.uoregon.edu!wn13feed!worldnet.att.net!204.127.198.204!attbi_feed4!attbi.com!rwcrnsc51.ops.asp.att.net.POSTED!not-for-mail From: Caffeine Junky Subject: Re: how to parse words from a string Newsgroups: comp.lang.ada References: User-Agent: Pan/0.11.3 (Unix) Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Comment-To: "Sarah Thomas" Message-ID: NNTP-Posting-Host: 12.241.145.39 X-Complaints-To: abuse@attbi.com X-Trace: rwcrnsc51.ops.asp.att.net 1037182642 12.241.145.39 (Wed, 13 Nov 2002 10:17:22 GMT) NNTP-Posting-Date: Wed, 13 Nov 2002 10:17:22 GMT Organization: AT&T Broadband Date: Wed, 13 Nov 2002 10:17:22 GMT Xref: archiver1.google.com comp.lang.ada:30798 Date: 2002-11-13T10:17:22+00:00 List-Id: On Tue, 12 Nov 2002 14:33:39 -0500, Sarah Thomas wrote: > i'm new to ada, could someone help me with the following: i need to read > in an input file and parse each line word by word. I read in each line > of text, but now i need to extract the words (separated by tabs) into an > array, how do i do that...would appreciate some suggestions, thanks One method I used was to declare some variables like this ... Break : Character := Tab --- Or space, or whatever -- subtype Word is String(1..Break); Then create an array (or presort into a Tree) of Words. type Word_Stack is array(Positive range 1..Max) of Word; Assuming of course your doing a buffer of some sort. The rest is elementary. Check out the Ada.Strings packages for more in depth info. Caffeine Junky