Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Comix 3.0 Reference Manual - <b>xindex</b> create an index using extended expressions http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
XINDEX               Create an index using extended expressions
------------------------------------------------------------------------------

Synopsis

    XINDEX ON <key>
          TO <cBag> | TAG <cTag> | TAG <cTag> TO <cBag>
          [FOR <for>]
          [WHILE <while>]
          [USECURRENT]
          [EVAL <eval> [ EVERY <nEvery> ]]
          [UNIQUE]
          [ADDITIVE]
          [DESCENDING]
          [CUSTOM]

Arguments

    XINDEX takes the same arguments as INDEX, _but_ both the key and FOR
    clause can be extended expressions.

Description

    XINDEX is identical to INDEX, _but_ both the key and FOR clause can be
    extended expressions.  This command is far more efficient than using
    INDEX with a macro (&).

    Important Notes:

    o   The TAG clause and/or the TO clause can be an extended expression 
        with either the INDEX or XINDEX commands.

    o   The key and FOR clause, however, can only be an extended expression
        with the XINDEX command.

    o   You should _not_ use XINDEX with non-extended expressions (use INDEX
        instead).

    o   The extended expression _cannot_ reference local variables (sorry,
        this is a limitation of Clipper; once code is compiled the local
        symbol name is long gone).  You may, however, use local variables
        with the INDEX command.

        The extended expression _can_ be stored in a local variable (as
        shown in the example below).  It simply can't reference a local
        variable.

Example

    local cKey := "last+first"
    local cFor := "age >= 30"

    //  index on (cKey) to lastFir              && Does NOT work!!!

    //  index on &cKey to lastFir               && Ugh!  The old way

    xindex on (cKey) to lastFir                 && Ahhh... cleaner & faster
    xindex on (cKey) to lastAge for (cFor)      && Even with a FOR!

See Also

    See the INDEX command for information on the arguments.


See Also: INDEX

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