MBINDEX

NLS Function: Performs the same function as INDEX except that the strings manipulated can contain multibyte characters.

Module: USE DFNLS

Syntax

result = MBINDEX (string, substring [, back])

string
(Input) CHARACTER*(*). String to be searched for the presence of substring. Can contain multibyte characters.


substring
(Input) CHARACTER*(*). Substring whose position within string is to be determined. Can contain multibyte characters.


back
(Optional; input) LOGICAL(4). If specified, determines direction of the search. If back is .FALSE. or is omitted, the search starts at the beginning of string and moves toward the end. If back is .TRUE., the search starts end of string and moves toward the beginning.

Results:

The result is of type INTEGER(4). If back is omitted or is .FALSE., returns the leftmost position in string that contains the start of substring. If back is .TRUE., returns the rightmost position in string which contains the start of substring. If string does not contain substring, returns 0. If substring occurs more than once, returns the starting position of the first occurrence ("first" is determined by the presence and value of back).

Compatibility

CONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS WINDOWS DLL LIB

See Also: INDEX, MBSCAN, MBVERIFY