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>sx_strxcheck():</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  Sx_StrxCheck():

  Syntax:   Sx_StrxCheck( [lStrict] )

            lStrict = Optional logical value.  A value of .T. turns strict
                      structural .CDX/.NSX checking on.  The default value is
                      .F. (off).

  Returns:  The previous setting.  If no parameter is passed, the current
            state is returned.

  Description:  If a database file has a structural .CDX/.NSX file, a byte in
                the header of the DBF indicates this.  If the structural
                index file is deleted, the SIx Driver (unlike FoxPro) will
                not generate an error when the DBF file is reopened.
                Instead, it just toggles that byte in the DBF header back to
                "No Structual" mode, and continues to open the DBF file
                uneventfully.

                FYI: The byte in the DBF file header that indicates if a
                     DBF file has a structural index file is at offset 28.
                     If it is zero (0), there is no structural index file.
                     A value of one (1) indicates that there is.

                If you would prefer an error code to be generated if a struc-
                tural index file is missing when a USE command is issued,
                call Sx_StrxCheck(.T.).  This will cause a SIX???/690 error
                to be generated, where "???" is either "CDX under SIXCDX or
                "NSX" under SIXNSX.

    NOTE:  This function is NOT supported under SIXNTX.

  Example:

    // Assuming TEST.DBF has a structural TEST.CDX file

    #include "SIXCDX.CH"

    USE test VIA "SIXCDX"         // Open TEST.DBF
    INDEX ON age TAG age          // Create TEST.CDX with AGE tag
    CLOSE                         // Close the files

    ERASE test.cdx                // Delete TEST.CDX
    USE test VIA "SIXCDX"         // Open TEST.DBF.  By default, no error
                                  // is generated and the byte in the header
                                  // of the DBF file is toggled to the
                                  // "No structural CDX" value (0).
    CLOSE                         // Close the file

    // Now lets rebuild the TEST.CDX file and set CDX checking on.

    USE test VIA "SIXCDX"         // Open TEST.DBF
    INDEX ON state TAG state      // Creates STATE tag within TEST.CDX
    CLOSE

    WAIT "So far so good.  Press a key to get SIXCDX/690 Error..."

    Sx_StrxCheck(.T.)             // Turn structural CDX checking on
    ERASE test.cdx                // Delete TEST.CDX
    USE test VIA "SIXCDX"         // Open TEST.DBF.  This will generate a
                                  // SIXCDX/690 error.


See Also: SIX???/690 Sx_AutoOpen()

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