INSTR

Syntax

Example

Description/Remarks

INSTR "text being searched", "text being sought"

If logged in as
"Data Entry Operator":

INSTR NAME, "Oper"

Returns 12

INSTR NAME, "Operator"

Returns 12

INSTR NAME, "Analyst"

Returns 0

INSTR NAME, "OPER"

Returns 0

This command indicates whether the "text being sought" can be found in the "text being searched". This command is case sensitive.

  • If successful, this command returns a number indicating the starting position of the matching text.  When used with an IF command, this result translates as "true" because it is greater than zero.

  • If the "text being sought" is not found in the "text being searched", this command returns the number zero.

To determine whether the two strings are equal, use the STRCOMP command.