$ Operator

Returns True (.T.) if a character expression is contained in another character expression; otherwise, returns False (.F.).

cSearchFor $ cSearchIn

Return Values

Logical

Parameters

  • cSearchFor
    Specifies the expression looked for within cSearchIn.

  • cSearchIn
    Specifies the expression that is searched to see if it contains cSearchFor.

    If cSearchFor is found in cSearchIn, $ returns True (.T.); otherwise, it returns False (.F.). cSearchFor and cSearchIn can be character-type variables or array elements, character-type fields, character string literals, or memo fields of any length.

    Memo fields can be manipulated like character expressions, fields in tables, variables, or array elements. For example, if MEMO_FLD is a memo field, the following is acceptable:

    LIST FOR 'FOX' $ UPPER(memo_fld)
    

Remarks

If the character expression is not found, False (.F.) is returned. The $ operator is case-sensitive and is not Rushmore optimizable.

Example

The following example creates a table called memotest containing one memo field. Three records are appended to the table. LIST is used to display the three records. The dollar sign ($) is used to list the records that contain the string "FOX". The files created for the example are then deleted.

CLOSE DATABASES
CLEAR
CREATE TABLE memotest (Text C(3), Memo M)
INSERT INTO  memotest (Text, Memo) VALUES ('Fox', 'Fox')
INSERT INTO  memotest (Text, Memo) VALUES ('Cat', 'Cat')
INSERT INTO  memotest (Text, Memo) VALUES ('FOX', 'FOX')
LIST FIELDS  Memo, Text FOR 'FOX' $ UPPER(Memo)
USE
DELETE FILE memotest.dbf
DELETE FILE memotest.fpt

See Also

% Operator | DELETE FILE Command | CREATE TABLE – SQL Command | Using Rushmore Query Optimization to Speed Data Access | AT( ) | Operators | ATLINE( ) | RAT( ) | RATLINE( ) | OCCURS( ) | INLIST( ) Function