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>cmxskipunique()</b> skip to next/previous unique key http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
cmxSkipUnique()       Skip to next/previous unique key
------------------------------------------------------------------------------

Synopsis

    cmxSkipUnique( [nDirection] ) -> NIL

Arguments

    nDirection is an optional parameter.  If omitted, it will default to 1
    (skip forward one unique key).  If less than 0, then the skip backwards
    by 1 will be done.  (You can only skip forward or backward one unique key
    at a time).

Returns

    NIL.

Description

    cmxSkipUnique() allows you to make a non-UNIQUE index "look like" a
    unique index.  Each time you cmxSkipUnique(), you are moved to the next
    unique key (exactly as if you were SKIP'ing through a UNIQUE index).

    This functions eliminates the problems associated with maintaining a
    UNIQUE index, while providing you with fast access to unique keys.

Example

    function aLastUnique()
        local aLast[0]

        set index to last               && Use the last name index
        set scope to 'J'                && Only look at the J's

        go top
        do while !eof()                 && Add all the unique J last names to
            aAdd(aLast, last)           && aLast
            cmxSkipUnique()
        enddo

        set scope to                    && Clear off the scope
    return aLast                        && Return the array of unique J names

See Also

    INDEX


See Also: INDEX

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