Microsoft KB Archive/98920

{|
 * width="100%"|

-

The information in this article applies to:


 * Microsoft FoxPro for Windows, versions 2.5, 2.5a
 * Microsoft FoxPro for MS-DOS, versions 2.0, 2.5, 2.5a

-

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 &quot;Attempting to Lock...Press escape to cancel&quot; being generated.

If SET REPROCESS is set to AUTOMATIC or -2 and the initial lock fails, the system message &quot;Attempting to Lock...Press escape to cancel&quot; 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 &quot;Attempting to Lock...Press escape to cancel&quot; 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 &quot;Attempting to Lock...press escape to cancel&quot; 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.

Steps to Reproduce Problem
 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. Issue the SET EXCLUSIVE OFF command in both sessions. Issue the SET STATUS ON command in both sessions. 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.  To create an ON ERROR routine, type the following in the Command window:       MODIFY COMMAND test   In the Test program window, type:       WAIT WINDOW  Press CTRL+W to save the program.</li>  To execute the ON ERROR routine, type the following in the Command window:  <pre class="CODESAMP">     ON ERROR DO test.prg </li> Repeat steps 1-4 to reproduce with the problem the ON ERROR routine active.</li></ol>

Additional query words: FoxDos FoxWin err msg errmsg

Keywords         : kberrmsg FxprgBrowse Version          : 2.50 2.50a | 2.00 2.50 2.50a Platform         : MS-DOS WINDOWS Issue type       :
 * }