FIND

Function

Determines the location of a character sequence within a string.

Syntax

FIND {{obj_txt_lit|_var|_col}|{date_var|_col}} IN
{{src_txt_var|_col}|{date_var|_col}}
{start_int_lit|_var} dst_location_int_var

Arguments

{obj_txt_lit|_var|_col}|{date_var|_col}

Text variable, column, or literal in src_txt_var|_col.

{src_txt_var|_col}|{date_var|_col}

Text variable or column to search.

start_int_lit|_var

Starting location of the search.

dst_location_int_var

Returned starting location of the left-most character of the matching text in {src_txt_var|_col|date_var|_col}.

Description

FIND searches the specified string for a character sequence and, if the string is found, returns its location as an offset from the beginning of the specified string. If the sequence is not found, FIND returns -1 in dst_location_int_var.

You must specify an offset from which to begin the search and supply a numeric variable for the return of the location.

If the source or search object is a date variable or column, it is converted to a string before the search according to the following rules:

Examples

find  'aw.2'  in  &code5  0  #loc
find  ','  in  &name  0  #comma_loc
if #comma_loc = -1
	...comma not found...

See Also