cfunc.locate C Function/C Functions


Command cfunc.locate C Function/C Functions
Applicable release versions: AP 6.1
Category C Functions (120)
Description equivalent to the Pick/BASIC statement: locate(string1, string2, ac.expression, vc.expression, start.expression, position.variable, string3) then result = 1 else result = 0

This function returns -1 if an error occurs. The error code is contained in _CP_errno.
Syntax int _CP_locate(int* result, CPSTR* string1, CPSTR* string2, int ac.expression, int vc.expression, int start.expression, int * position.variable, CPSTR* string3)
/* The following example prints "1 2". */

CPSTR * s = _CP_mkstr("a376b");
CPSTR * t = _CP_mkstr("b");
int r,l;

printf("%d %dn", r, l);
Related cfunc.introduction