JavaScript Editor js editor     Web development 



Main Page

Returns the beginning numeric position of the first occurrence of a character expression or memo field within another character expression or memo field, without regard for the case of these two expressions.

ATC(cSearchExpression, cExpressionSearched [, nOccurrence])

Parameters

cSearchExpression


Specifies the character expression that ATC(В ) searches for in cExpressionSearched.
cExpressionSearched


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


Specifies which occurrence (first, second, third, and so on) of cSearchExpression is searched for in cExpressionSearched. By default, ATC(В ) searches for the first occurrence of cSearchExpression (nOccurrence = 1). Including nOccurrence lets you search for additional occurrences of cSearchExpression in cExpressionSearched.

Return Value

Numeric

Remarks

ATC(В ) searches the second character expression for the occurrence of the first character expression, without concern for the case (upper or lower) of the characters in either expression. Use AT(В ) to perform a case-sensitive search.

ATC(В ) returns an integer corresponding to the position where the first character of the character expression is found. If the character expression isn't found, ATC(В ) returns 0.

Example

В Copy Code
STORE 'Now is the time for all good men ... ' TO gcString
STORE 'IS THE' TO gcFindString
CLEAR
? ATC(gcFindString, gcString)  && Displays 5
STORE 'is' TO gcFindString
? ATC(gcFindString, gcString)  && Displays 5
? ATC('now',gcString)  && Displays 1

See Also



JavaScript Editor js editor     Web development