AT( ) Function

JavaScript Editor js editor     Web development 



Main Page

Searches a character expression for the occurrence of another character expression.

Note:
The search performed by AT(В ) is case-sensitive. To perform a search that is not case-sensitive, use ATC(В ). For more information, see ATC( ) Function.

AT(cSearchExpression, cExpressionSearched [, nOccurrence])

Parameters

cSearchExpression


Specifies the character expression to search for in cExpressionSearched.
cExpressionSearched


Specifies the character expression to search for cSearchExpression. Both cSearchExpression and cExpressionSearched can be memo fields of any size.
nOccurrence


Specifies which occurrence, first, second, third, and so on, of cSearchExpression to search for in cExpressionSearched. By default, AT(В ) searches for the first occurrence of cSearchExpression (nOccurrence = 1).

Return Value

Numeric. AT(В ) returns an integer indicating the position of the first character for a character expression or memo field within another character expression or memo field, beginning from the leftmost character. If the expression or field is not found, or if nOccurrence is greater than the number of times cSearchExpression occurs in cExpressionSearched, AT(В ) returns 0.

Example

В Copy Code
STORE 'Now is the time for all good men' TO gcString
STORE 'is the' TO gcFindString
CLEAR
? AT(gcFindString,gcString)  && Displays 5
STORE 'IS' TO gcFindString
? AT(gcFindString,gcString)  && Displays 0, case-sensitive

See Also



JavaScript Editor js editor     Web development