[TOC] [Prev] [Next] [Bottom]

<@LOCATE>

Syntax

<@LOCATE STR=string FINDSTR=substring>

Description

Returns the starting position of substring in string. If substring is empty, omitted, or not in string, <@LOCATE> returns "0". If substring occurs more than once in string, the position of the first occurrence is returned.

The operation of <@LOCATE> is case sensitive. In order for a match to be found, substring must occur inside string exactly as it is specified, including case.

Each of the attributes to <@LOCATE> may be specified as a literal value, a meta tag that returns a value, or a combination of both.

Examples

<@LOCATE STR="A test string" FINDSTR="test">

This example evaluates to "3".

<@LOCATE STR="Not in here" FINDSTR="help">

This example evaluates to "0".

<@LOCATE STR="The rain in Spain" FINDSTR="ain">

This example evaluates to "6".

<@LOCATE STR="Welcome to my home page." FINDSTR="come">

This example evaluates to "4".

<@LOCATE STR="Tango 2000" FINDSTR="tango">

This example evaluates to "0", because an exact match of "tango", including case, is not found in the source string.

<@LOCATE STR="<@LOWER STR='Tango 2000'>" FINDSTR="tango">

This example evaluates to "1."



[TOC] [Prev] [Next] [Bottom]

docs@pervasive.com
Copyright © 1999, Pervasive Software. All rights reserved.