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,364deb6698b494cb,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-06-01 06:31:32 PST Path: archiver1.google.com!news2.google.com!postnews1.google.com!not-for-mail From: amuhtar@uoguelph.ca (Xcalibre) Newsgroups: comp.lang.ada Subject: Ada String Issue: String within Strings Date: 1 Jun 2001 06:31:32 -0700 Organization: http://groups.google.com/ Message-ID: <4713a80b.0106010531.7f6f4da8@posting.google.com> NNTP-Posting-Host: 216.129.6.66 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 991402292 5625 127.0.0.1 (1 Jun 2001 13:31:32 GMT) X-Complaints-To: groups-support@google.com NNTP-Posting-Date: 1 Jun 2001 13:31:32 GMT Xref: archiver1.google.com comp.lang.ada:7967 Date: 2001-06-01T13:31:32+00:00 List-Id: Just a little hello and little comment that I've enjoyed reading through this newsgroup. My problem is this: I am Get_Line-ing from a file... what I want to do is check that line of text for a particular phrase given (not just a word). I've tried using Index() and I get an Error that says... extract.adb:73:66: array type required in indexed component The code reads: Get_Line (f_From, LineItem, Index); while (not End_Of_File(f_From)) loop Found := 0; Found := Index (LineItem(1..Index), Catch); if Found > 0 then Put_Line(f_To, LineItem(1..Index)); end if; end loop; where LineItem, Catch : String(1..1024); Found : Natural; Is what I am doing the right idea or is there a different built in function that will do what C does in comparing the text and returning the location of where it starts? Thanks in advance Andrew