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

    INDEXBAR() displays a graph showing percentage complete when
    indexing files.  It is very reassuring for users during creation of
    large index files.  Plus, it goes the extra step to strip the UDF()
    call out of the .NTX file so that you will not have to worry about
    displaying the graph during the course of normal index file
    maintenance.

    Syntax

    INDEXBAR(<cFile>, [<cKey>] [, <nRow>] [, <lShowcount>] [, <lUnique>] )

    Required Parameter

    <cFile> is a character string representing the name of the index
    file being built.  It will be displayed in the graph window.

    Optional Parameters

    <cKey> is a character string containing the key on which to create
    the index file.  If you do not pass this parameter, the index key
    will be assumed to be the same as the <filename>.

    <nRow> represents the top row of the graph window.  If you do not
    pass this parameter, the graph window will be centered horizontally.

    <lShowcount> dictates whether or not to display an incrementing
    record counter along with the graph.  Pass True (.T.) if you want
    the record counter.  By default, it will not be provided. Using this
    will certainly slow the indexing process, but some users need an
    extra degree of hand-holding.

    Clipper 5.0 Optional Parameter

    <lUnique> dictates whether or not to make the index UNIQUE. Pass
    True (.T.) for a UNIQUE index.  By default, the index will not be
    UNIQUE.

    Return Value

    A logical value: True (.T.) if the index was built, False (.F.) if
    not. Reasons why it would not be built include an invalid index key
    or an empty database.

    Notes

    INDEXBAR() displays a graph showing the percentage complete of an
    indexing process.  There are trade-offs for this degree of user
    feedback, namely, performance.  But it is often worth it.

    After the index is built, INDEXBAR() will strip the UDF() call out
    of the .NTX file and replace it with the actual index key.  This is
    accomplished by first closing the index (using SET INDEX TO) and
    then using the FOPEN() and FWRITE() functions.  INDEXBAR() then
    re-opens the index.

    Sample Usage

    USE customer                                     
    INDEXBAR('customer', 'upper(lname)')             
    INDEXBAR('custno')           && use CUSTNO as key
    INDEXBAR('custno',,,,.t.)    && UNIQUE index     
    INDEXBAR('customer', 'blah') && returns False    

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