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>cmxkeyadd()</b> add a key to a custom built index http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
cmxKeyAdd()           Add a key to a Custom Built Index
------------------------------------------------------------------------------

Synopsis

    cmxKeyAdd( [nOrder] | [cTag [, cBag]] ) -> lSuccess

Arguments

    nOrder, cTag and cBag are optional parameters which specify the index.
    If omitted, the current master index will be used.

    nOrder is the numeric order of the index.

    cTag is the tag of the index, and cBag is the specific index file in
    which to find cTag.

Returns

    cmxKeyAdd() returns .T. if the key was successfully added, .F.
    otherwise.

    cmxKeyAdd() will fail if:

    o   You are not on a valid record (i.e., at EOF())
    o   The index is not a Custom Built Index.
    o   The specified index does not exist.
    o   No index was specified and there is no master index.

Description

    cmxKeyAdd() adds a key to a Custom Built Index.  A Custom Built Index is
    an index which is _not_ automatically maintained by Comix.  Instead,
    you explicitly add and delete keys from the index using the cmxKeyAdd()
    and cmxKeyDel() functions.

    cmxKeyAdd() evaluates the key expression for the index, and then adds
    the key for the current record to the index.  If the index has a FOR
    condition, the key will only be added if the FOR condition is met.

    The index must be a Custom Built Index (it is an error to call
    cmxKeyAdd() for a non-Custom Built Index).

    NOTE:   You can add the same key for the same record multiple times.

Example

    use demo
    index on last to last custom                && Create Custom Built Index
                                                && Initially empty

    for n := 1 to recCount() step 50            && Add every 50'th record
        goto n
        cmxKeyAdd()
    next n

    list last                                   && Record 1, 51, etc.

See Also

    cmxCustom(), cmxFor(), cmxKeyDel()


See Also: cmxCustom() cmxFor() cmxKeyDel()

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