Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Clipper Tools One Guide - <b>complement()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
COMPLEMENT()

Syntax:     COMPLEMENT([@],<expX>)

Arguments:  <expX> may be an expression of any type, and can be
            reference sensitive if prefixed by an "@".

Returns:    Variable.
            Corresponds to the complement of <expX> of the same
            data type.

Usage:      COMPLEMENT() will return the corresponding counterpart to
            any argument.  Unlike CHARNOT(), where it is only possible
            to process strings, all data types are allowed in this function.
            The result will receive the same type as the argument.  The
            result of a date will again be a date corresponding to the
            difference between the date given and the date 12/31/2999.

Notes:      COMPLEMENT(COMPLEMENT(<expX>)) will always produce
            the output value <expX>.

Library:    CT1.LIB


--------------------------------- Example ------------------------------

Examples:   * The complement for logic values matches
            * the use of .NOT..
            ? COMPLEMENT(.T.)                   && Result: .F.
            ? COMPLEMENT(.F.)                   && Result: .T.

            * Numerical values will change their sign.
            ? COMPLEMENT(99)                    && -99.00
            ? COMPLEMENT(0)                     && -0.00
            ? COMPLEMENT(-99)                   &&  99.00
            ? COMPLEMENT(-9.9)                  &&  9.90
            ? COMPLEMENT(9.9)                   && -9.90

            * The function will operate like CHARNOT()
            * for strings.

            ? COMPLEMENT("qrstuvxyz")           && "........."

            SET CENTURY ON
            * All date complements will be taken from
            * 12/31/2999.
            ? COMPLEMENT(CTOD("12/31/1999"))    && 01/01/1000
            ? COMPLEMENT(CTOD("01/01/1900"))    && 12/31/1099

            * A blank or invalid date will lead to the
            * same result: 12/31/2999
            ? COMPLEMENT(CTOD("  /  /    "))    && 12/31/2999
            ? COMPLEMENT(CTOD("77/77/7777"))    && 12/31/2999




Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson