[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
+---------------------------------+
|          SET REPROCESS          |
+---------------------------------+
SET REPROCESS TO <expN> [SECONDS]
        | TO AUTOMATIC

-----------------------------------
Specifies how FoxPro/LAN controls unsuccessful record or file locks.
Default value - 0
-----------------------------------

A record or file lock is not always successful on the first attempt.
Frequently a record or file has been locked by another user on the
network.  SET REPROCESS lets you control how unsuccessful record and
file locks are handled.  If an initial record or file lock is
unsuccessful, SET REPROCESS controls whether additional attempts will be
made to lock the record or file.  You may specify either the number of
times additional attempts will be made, or how long the attempts will be
made.  The presence of an ON ERROR routine affects the reaction to an
unsuccessful lock attempt.

The SET REPROCESS value, <expN>, can be set to an integer value between
-2 and 32,000.  You can also SET REPROCESS TO AUTOMATIC.  The following
describes the effect of different values of <expN> and AUTOMATIC on SET
REPROCESS.

Clauses
-------

TO <expN>
        Specifies how many times FoxPro/LAN will try to lock a record after an
unsuccessful attempt.  The default value for <expN> is 0.

        The following examples discuss the effect of specifying different
values for <expN>.

SET REPROCESS TO 0
        If you SET REPROCESS TO 0 (the default value) and issue a command or
function that attempts to lock a record or file, FoxPro/LAN will attempt
to lock the record or file indefinitely.  The system message "Attempting
to lock... Press ESC to Cancel." is displayed while FoxPro/LAN attempts
to lock the record or file.  If the record or file becomes available for
locking while you wait, the lock is placed and the system message is
cleared.  True (.T.) is returned if a function placed the lock.

        If you press Escape in response to the system message an appropriate
alert is displayed (for example, "Record is in use by another.").  If a
function attempted to place the lock, the alert is not displayed and a
false (.F.) is returned.   If an ON ERROR routine is in effect and a
command is attempting to lock the record or file, the ON ERROR routine
takes precedence over additional attempts to lock the record or file.
The ON ERROR routine is immediately executed - no additional record or
file locks are attempted and the system message is not displayed.

        If a function attempted to place the lock, the system message is not
displayed, an ON ERROR routine will not be executed and a logical false
(.F.) is immediately returned.

SET REPROCESS TO -1
        If you SET REPROCESS TO -1, FoxPro/LAN attempts to lock the record or
file indefinitely.  You cannot cancel the locking attempts by pressing
the Escape key, and an ON ERROR routine will not be executed.

        A system message ("Waiting for lock...") will only be displayed if
STATUS is SET ON.

        If a lock has been placed by another user on the record or file you are
attempting to lock you must wait until that user's lock is released.
This could be a long, long time.

SET REPROCESS TO <expN> > 0
        If the SET REPROCESS value <expN> is greater than 0 you may specify how
many times or for how long FoxPro/LAN will attempt to lock a record or
file.

        For example, if you SET REPROCESS TO 30 FoxPro/LAN will attempt to lock
a record or file up to 30 times.  If you also include the optional
keyword SECONDS (SET REPROCESS TO 30 SECONDS), FoxPro/LAN will
continuously attempt to lock a record or file for up to 30 seconds.

        A system message ("Waiting for lock...") will only be displayed if
STATUS is SET ON.

        If an ON ERROR routine is not in effect and the record or file lock
cannot be placed an appropriate alert is displayed (for example, "Record
is in use by another.").  If a function attempted to place the lock, the
alert is not displayed and a logical false (.F.) is returned.

        If an ON ERROR routine is in effect and the command locking attempts
were unsuccessful, the ON ERROR routine is then executed.  If a function
attempted the lock, an ON ERROR routine will not be executed and a
logical false (.F.) is returned.

TO <expN> [SECONDS]
        Specifies how long (in seconds) FoxPro/LAN will try to lock a record
after an unsuccessful attempt.

TO AUTOMATIC
        If you SET REPROCESS TO AUTOMATIC (or identically SET REPROCESS TO -2),
FoxPro/LAN will attempt to lock the record or file indefinitely.  The
system message "Attempting to lock... Press ESC to Cancel" is displayed
while FoxPro/LAN attempts to lock the record or file.  If the record or
file becomes available to lock while you wait, the lock is placed and
the system message is cleared.  If a function was used to place the lock
a logical true (.T.) is returned.

        If an ON ERROR routine is not in effect and you press Escape in
response to the system message, an appropriate alert is displayed (for
example, "Record is in use by another").  If a function attempted to
place the lock, the alert is not displayed and a logical false (.F.) is
returned.

        When an ON ERROR routine is in effect and Escape is pressed the ON
ERROR routine is executed.  If a function attempted to place the lock an
ON ERROR routine is not executed and a logical false (.F.) is returned.

-----------------------------------

See Also:  FLOCK(), LOCK(), ON ERROR, RLOCK(), SET STATUS

-----------------------------------

See Also: FLOCK() LOCK() ON ERROR RLOCK() SET STATUS
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson