[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
+---------------------------------+
|              LIKE               |
+---------------------------------+
LIKE(<expC1>, <expC2>)

-----------------------------------
Compares two character expressions.
Return value - Logical
-----------------------------------

LIKE() returns true or false to indicate whether a character pattern
<expC1>
matches another character expression <expC2>.  If <expC1> matches
<expC2>, LIKE() returns true (.T.); otherwise false (.F.) is returned.
LIKE() is case-sensitive, but wild card characters (* and ?) in <expC1>
will match either lower-case or upper-case characters.

The current setting of SET COMPATIBLE determines how LIKE() evaluates
<expC1> and <expC2> before searching for <expC1> in <expC2>.  If
COMPATIBLE is SET ON, <expC1> and <expC2> will have all trailing blanks
removed before the search begins.  If COMPATIBLE is SET OFF, trailing
blanks in <expC1> and <expC2> are used in the search.

Clauses
-------

<expC1>
        <expC1> is a character pattern.  The wild card characters * and ? can
be included in <expC1>.  The question mark is substituted for one
character and the asterisk is substituted for any number of characters.
You can mix any number of wild card characters in any position within
<expC1>.

<expC2>
        LIKE() searches <expC2> for a match with the character pattern <expC1>.

+---------------------------------+
|             Example             |
+---------------------------------+
In this example, a list of all file cabinets from the ITEMS database is
displayed to the screen with a reduced price (10 percent off).

CLOSE ALL
USE items
? '10% Off ALL File Cabinets!'
SCAN FOR LIKE('*ile cabinet*', descript)
        ? descript + '  PRICE = $' + LTRIM(STR(price - (price * .10)))
ENDSCAN

-----------------------------------

See Also:  $, AT(), ATC(), OCCURS(), RAT()

-----------------------------------

See Also: $ AT() ATC() OCCURS() RAT()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson