$STORAGE: 2
      INTEGER FUNCTION INDEX ( STR, C )
C
      CHARACTER * 1 C, STR ( 1 )
C
C LIMIT RANGE OF SEARCH TO 256 BYTES. THIS IS ARBITRARY BUT I DOUBT
C ANALYTICALC WILL EVER DEAL IN LONGER STRINGS THAN THIS AND
C SEARCHES ALL OVER THE CREATION ARE TO BE AVOIDED.
      DO 20019  I = 1, 256
      IF (.NOT.( STR ( I ) .EQ. 0 )) GOTO 20021
C RETURN INDEX AS EITHER THE LOCATION OF THE CHARACTER OR OF THE
C END OF THE STRING FOR ANALYTICALC. NOTE THAT THIS DIFFERS
C FROM USUAL RATFOR VERSION.
      INDEX=I
      RETURN
20021 CONTINUE
      IF (.NOT.( STR ( I ) .EQ. C )) GOTO 20023
      INDEX = ( I )
      RETURN
20023 CONTINUE
20022 CONTINUE
C
20019 CONTINUE
20020 CONTINUE
      END
