c_index - Finds the position of one string within another

SYNTAX

#include "worgen.h"

FUNCTION c_index (string1, string2, pos)

     char               *string1;
     char               *string2;
     long               *pos;

PARAMETERS

string1 (input, character, length(*))

The ASCII character string to be searched. The position of the character substring specified by string2 is returned in the parameter pos.

string2 (input, character, length(*))

The ASCII character substring to be searched for in the input string specified by string1. The position of string2 within string1 is returned in the parameter pos.

pos (output, integer)

The position of string2 within string1. The value returned is 1 relative and 0 is returned if string2 is not found within string1.

DESCRIPTION

The c_index() routines determines whether string2 is a substring of string1 and returns the position (1 relative) of the substring. If string2 either string is a null string, a 0 is returned as the position. Note that this routine is callable from C only. This is because FORTRAN has its own intrinsic function (also called index()) position of one string within another.

RETURN VALUE

c_index() has no return values.

SPECIAL CONSIDERATIONS

The c_index() call is for C only.