PRB: SET REPROCESS and ON ERROR Routines; "Attempting to Lock"

ID: Q98920

2.50 2.50a | 2.00 2.50 2.50a

WINDOWS         | MS-DOS
  kbprb

The information in this article applies to:

SYMPTOMS

The automatic locking commands call an ON ERROR routine depending upon the setting of SET REPROCESS, but the manual locking commands do not call an ON ERROR routine.

When SET REPROCESS is set to 0 (the default), an ON ERROR routine will be called when you attempt to lock a record or file instead of the error message "Attempting to Lock...Press escape to cancel" being generated.

If SET REPROCESS is set to AUTOMATIC or -2 and the initial lock fails, the system message "Attempting to Lock...Press escape to cancel" will be displayed. When ESC is pressed, the ON ERROR routine is called.

When manual locks [LOCK(), FLOCK(), RLOCK()] are used, if SET REPROCESS is set to 0, the system message "Attempting to Lock...Press escape to cancel" is not displayed and the ON ERROR routine is not called.

If SET REPROCESS is set to -2 and manual locking commands are being used, the system message "Attempting to Lock...press escape to cancel" will be displayed. If ESC is pressed, the ON ERROR routine will not be called. The manual locking commands do not call an ON ERROR routine because they simply return a logical .T. or .F. value indicating whether the file is locked or not.

MORE INFORMATION

Steps to Reproduce Problem

1. Start two sessions of FoxPro running on a single machine, either in

   Windows or another multitasking environment, or run it on two
   different machines on a network.

2. Issue the SET EXCLUSIVE OFF command in both sessions.

3. Issue the SET STATUS ON command in both sessions.

4. Open a .DBF file and browse it in the first session of FoxPro and

   then type something in the first record so that the status bar
   shows the record as locked. Then open the same .DBF file in the
   second session of FoxPro and try to type something in the same
   record that is currently locked.

5. To create an ON ERROR routine, type the following in the Command
   window:

      MODIFY COMMAND test

6. In the Test program window, type:

      WAIT WINDOW

7. Press CTRL+W to save the program.

8. To execute the ON ERROR routine, type the following in the Command

   window:

      ON ERROR DO test.prg

9. Repeat steps 1-4 to reproduce with the problem the ON ERROR routine
   active.

Additional reference words: FoxDos FoxWin 2.00 2.50 2.50a err msg errmsg
KBCategory:   kbprb
KBSubcategory: FxprgBrowse
Keywords          : kberrmsg FxprgBrowse 
Version           : 2.50 2.50a | 2.00 2.50 2.50a
Platform          : MS-DOS WINDOWS

Last Reviewed: May 22, 1998