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>cmxautoshare()</b> get/set automatic sharing control mode http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
cmxAutoShare()        Get/set automatic sharing control mode
------------------------------------------------------------------------------

Synopsis

    cmxAutoShare([nMode]) -> nPrevMode

Arguments

    nMode is an optional parameter.  If not provided, the current automatic
    sharing mode is returned without changing it.

    If nMode is 0, then no automatic sharing control is done.  This is
    the way that the DBFNTX driver acts (but is _not_ the default for
    Comix).  This is primarily useful when developing network applications
    in a stand-alone environment.  This lets Clipper do its checking that a
    lock is obtained before a record is updated.

    If nMode is 1 (the default), Comix automatically determines at
    runtime if the app is running in a network environment.  If the app is
    _not_ running in a network environment, then Comix will automatically
    USE any database EXCLUSIVE.  This default mode is powerful as it allows
    you to write all of your code as network aware, while still getting
    optimal performance when your app runs in single-user mode.

    If nMode is 2, then all USE's are treated as EXCLUSIVE.  This is
    useful for developers who sell stand-alone applications and LAN versions
    of the same application (for more $).  This mode allows you to write all
    of your code as network aware.  Then by calling cmxAutoShare(2), you can
    make your network app run as guaranteed single-user.

Returns

    cmxAutoShare() returns the sharing mode before the function was invoked.

Description

    cmxAutoShare() gives you control over the automatic handling of file
    sharing done by Comix.  This is described in the Arguments section
    above.

    Normally this function is called only once at the start of your
    application.  The mode selected is in effect for all subsequent USE's.

Example

    ? cmxAutoShare()            && Returns 1 (the default mode)

Example

    cmxAutoShare(0)             && Set so that network testing can be done
                                && in stand-alone environment.

Example

    cmxAutoShare(2)             && Set so that all USE's are done EXCLUSIVE

    use demo shared             && The SHARED will be ignored, and the file
                                && will be opened EXCLUSIVE, guaranteeing
                                && that your app runs single-user with only
                                && one function call, and without changing
                                && any of your PRG's

See Also

    None.


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