Re: index function problem
- From: relaxmike <michael.baudin@xxxxxxxxx>
- Date: Thu, 27 Mar 2008 05:51:09 -0700 (PDT)
Hi,
This is a fixed version (the appearance may be altered by the forum):
character(len=150) :: text='IF A PROGRAMMER IS FOUND TO BE
INDISPENSABLE,&
&THE BEST THING TO DO IS TO GET RID OF HIM AS SOON AS POSSIBLE'
!character(80) :: text='IS A PROGRAMMER IS'
character(len=2) :: pattern ='IS'
First, the long string is spread over two lines so that one have
to finish the first line with a "&" and start the next one
with another "&" : the full string will then be correctly
computed.
Second, the "index" intrinsic accepts only character(len=<something>)
arguments. Here the first argument had type character, dimension(150),
which is an array of character, not a string.
For string manipulation itself, you may find interesting to
use the "flibs" project :
http://flibs.sourceforge.net/
where you will find several string algorithms which may be useful,
for example "string_match( string, pattern)".
Best regards,
Michaël
.
- Follow-Ups:
- Re: index function problem
- From: Richard Maine
- Re: index function problem
- References:
- index function problem
- From: utab
- index function problem
- Prev by Date: Re: index function problem
- Next by Date: Re: what is wrong with this code?can someone walk me through this?
- Previous by thread: Re: index function problem
- Next by thread: Re: index function problem
- Index(es):
Relevant Pages
|