Freigeben über


AT( ) Function

Returns the beginning numeric position of the first occurrence of a character expression or memo field within another character expression or memo field, counting from the leftmost character.

AT(cSearchExpression, cExpressionSearched [, nOccurrence])

Return Values

Numeric

Parameters

  • cSearchExpression
    Specifies the character expression that AT( ) 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, AT( ) searches for the first occurrence of cSearchExpression (nOccurrence = 1). Including nOccurrence lets you search for additional occurrences of cSearchExpression in cExpressionSearched. AT( ) returns 0 if nOccurrence is greater than the number of times cSearchExpression occurs in cExpressionSearched.

Remarks

AT( ) searches the second character expression for the first occurrence of the first character expression. It then returns an integer indicating the position of the first character in the character expression found. If the character expression isn't found, AT( ) returns 0.

The search performed by AT( ) is case-sensitive. To perform a search that isn't case-sensitive, use ATC( ).

Example

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

AT_C( ) | ATC( ) | ATCLINE( ) | ATLINE( ) | LEFT( ) | RAT( ) | RATLINE( ) | RIGHT( ) | SUBSTR( ) | ATCC( ) | LEFTC( ) | RIGHTC( ) | SUBSTRC( ) | $ Operator | OCCURS( ) | INLIST( )