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>cmxsys()</b> provide low-level control over comix's operation http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
cmxSys()              Provide low-level control over Comix's operation
------------------------------------------------------------------------------

Synopsis

    cmxSys(nRequest [, xParms]) -> xValue

Arguments

    nRequest is the number of the system request to perform.  It can be any
    of the following numeric values:

        1001:   Turn strict read of records through RDD hierarchy on or off
                (by default it is off for greater efficiency)

        1002:   Turn force hard commit for COMMIT, dbCommit() or
                dbCommitAll() on or off (by default it is off for
                substantially improved performance)

    xParms varies depending on the specific request being made.

Returns

    cmxSys() returns different values depending on the system request made.

Description

    cmxSys() is a general purpose function used to provide low-level control
    over the Comix RDD's operation.  It performs different functions based
    on the value of nRequest.

    Currently, there are two system requests supported:

    cmxSys(1001, lStrictRead) -> lPrevStrictRead

        lStrictRead is a logicial.  If .F. (the default), then Comix will
        read in records directly from disk when creating indexes.  If .T.,
        then Comix will use the RDD DBF layer to read in records when
        creating indexes.

        cmxSys(1001) returns the previous setting of the strict read flag.

        This request is _only_ useful if you are using an RDD layer which
        encrypts the DBF (e.g., RDDKit or NetLib encryption).

        By default, Comix bypasses the RDD DBF layer and reads records
        directly from disk when creating indexes to improve performance.

        However, _if_ you are using encryption package, Comix will see the
        encrypted value rather than the actual value of the records, giving
        incorrect results.

        In order to use Comix with encryption packages, use the cmxSys(1001)
        call to force Comix to use the DBF RDD layer to read records when
        creating an index (i.e., cmxSys(1001, .t.)).

        By default, this option is .F., which provides the best possible
        performance when creating indexes.

    cmxSys(1002, lForceHard) -> lPrevForceHard

        lForceHard is a logical.  If .F. (the default), Comix does not force
        DOS to physically write to disk when a COMMIT is done.

        If set to .T., then Comix will force DOS to physically write to disk
        when a COMMIT is done.

        The return value will be the previous setting of the force hard
        commit flag.

        NOTE:   There is a lot of misleading information about the necessity
                of COMMIT's.  They are NOT necessary even in a multi-user
                system.

                COMMIT's _definitely_ degrade system performance with no
                benefit in most cases.

                However, if you have users who routinely give the 3 finger
                salute, press Reset, or simply turn off their system before
                exiting your program (_especially_ in single-user systems),
                you may well want to set this switch to .T. and use COMMIT.

Example

        //  cmxSys(1001) (Set Strict Read Flag) example
        
    lPrev := cmxSys(1001, .t.)          && Set strict read on
    ...                                 && Do index operations
    cmxSys(1001, lPrev)                 && Restore the previous strict read
                                        && setting

Example

        //  cmxSys(1002) (Set Force Hard Commit Flag) example

    lPrev := cmxSys(1002, .t.)          && Force hard commits to be done
    commit                              && Now commit
                                        && Once COMMIT is done, user can
                                        && reboot, etc. & indexes will be in
                                        && a stable state
    cmxSys(1002, lPrev)                 && Restore previous hard commit
                                        && setting

See Also

    None.


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