Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- SIx Driver RDD v3.00 - Reference Guide - <b>reindex:</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  REINDEX:

  Syntax:

  REINDEX [OPTION <expUDF> [STEP <nRecs>]]

  OPTION <expUDF> is an expression (normally a UDF) that is evaluated
  for each record indexed.  This allows the program to display an some type of
  completion/process meter without having the UDF embedded in the index
  expression.

  The expression is first eval'd at the beginning of the index process,
  with the record pointer positioned at EOF.  The following eval's take
  place at record 1, 2, etc. or whatever the STEP parameter has been set
  to (see below).  The record number can be tested within your UDF using
  RECNO().

  STEP <nRecs> is used to specify how often the OPTION expression will be
  evaluated.  <nRecs> is a numeric value representing the number of records
  that will be processed before the OPTION expression is evaluated.  For
  example:

          REINDEX OPTION MyFunc() STEP 10

  In this example MyFunc() would be called every 10 records.  The default
  step value is 1.


Example:

  #include "SIXCDX.CH"

  USE TEST VIA "SIXCDX"             // TEST.CDX opened automatically
  REINDEX OPTION ShowIt() STEP 10

  //----------------------------------------------------------------
  FUNC ShowIt()

    // BOF() is .T. on first call to OPTION UDF.  Use this for setup.
    IF BOF()
      // Display the appropriate message
      ? IF(Sx_IsReindex(), "Reindexing ", "Indexing ")

      // Display the index file name and tag name.
      ? Sx_I_IndexName() + " : " + Sx_I_TagName()
      ?
      Return(NIL)
    ENDIF

    // Show how many keys have been included so far
    @ Row(),1 SAY Sx_KeysIncluded()

  Return(NIL)



See Also: INDEX SUBINDEX OrdCondSet() OrdRebuild()

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