comp.lang.ada
 help / color / mirror / Atom feed
From: amuhtar@uoguelph.ca (Xcalibre)
Subject: Ada String Issue: String within Strings
Date: 1 Jun 2001 06:31:32 -0700
Date: 2001-06-01T13:31:32+00:00	[thread overview]
Message-ID: <4713a80b.0106010531.7f6f4da8@posting.google.com> (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



             reply	other threads:[~2001-06-01 13:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-01 13:31 Xcalibre [this message]
2001-06-01 14:04 ` Ada String Issue: String within Strings 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
replies disabled

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