Compartir a través de


OCCURS( ) Function

Returns the number of times a character expression occurs within another character expression.

OCCURS(cSearchExpression, cExpressionSearched)

Return Value

Numeric

Parameters

  • cSearchExpression
    Specifies a character expression that OCCURS( ) searches for within cExpressionSearched.

  • cExpressionSearched
    Specifies the character expression OCCURS( ) searches for cSearchExpression.

Remarks

OCCURS( ) returns 0 (zero) if cSearchExpression isn't found within cExpressionSearched.

Example

STORE 'abracadabra' TO gcstring
CLEAR
? OCCURS('a', gcstring)  && Displays 5
? OCCURS('b', gcstring)  && Displays 2
? OCCURS('c', gcstring)  && Displays 1
? OCCURS('e', gcstring)  && Displays 0

See Also

Reference

$ Operator

AT( ) Function

ATLINE( ) Function

RAT( ) Function

RATLINE( ) Function

INLIST( ) Function

Other Resources

Functions