NAME

instr - search for pattern in string

SYNOPSIS

#include <basic/string.h>

short instr(n, s, t)
short n;
struct string *s, *t;

DESCRIPTION

Instr returns the location of the first occurrence of the string pointed to by t in the string pointed to by s starting with location n.  Locations are numbered starting with one.  If the string pointed to by t is the null string, n is returned. 

This function implements the BASIC INSTR function. 

SEE ALSO

string(inc)
instr(func)

DIAGNOSTICS

Error 5 (Illegal function call) is generated if n is non-positive. 

Instr returns zero if the search fails or if location n lies beyond the end of the string pointed to by s

from The Basmark QuickBASIC Programmer’s Manual by Lawrence Leinweber