comp.lang.ada
 help / color / mirror / Atom feed
* Ada String Issue: String within Strings
@ 2001-06-01 13:31 Xcalibre
  2001-06-01 14:04 ` Mark Johnson
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Xcalibre @ 2001-06-01 13:31 UTC (permalink / raw)


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



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2001-06-01 17:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-01 13:31 Ada String Issue: String within Strings Xcalibre
2001-06-01 14:04 ` Mark Johnson
2001-06-01 17:43   ` tmoran
2001-06-01 14:04 ` James Rogers
2001-06-01 14:43 ` Ted Dennison
2001-06-01 15:07   ` Ted Dennison

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox