PRB: The REQUIRED Clause of VALID Is Not Supported in FoxPro

Last reviewed: June 28, 1995
Article ID: Q114755
The information in this article applies to:
  • Microsoft FoxPro for Windows, versions 2.5, 2.5a, 2.5b, 2.6
  • Microsoft FoxPro for MS-DOS, versions 2.0, 2.5, 2.5a, 2.5b, 2.6
  • Microsoft FoxPro for Macintosh, version 2.5b

SYMPTOMS

The VALID clause of a GET is executed when no changes have been made to the field or memory variable.

CAUSE

In dBASE IV, the VALID clause of a GET is executed only when the contents of the GET field or memory variable have been changed. The VALID clause is not executed when the cursor is moved out of a GET field or memory variable and no changes were made to the contents of that field or memory variable. In FoxPro, the VALID clause of a GET is always executed when the cursor is moved out of the GET. dBASE IV provides a REQUIRED clause for the VALID clause.

In dBASE, this optional clause is used to force a VALID to be executed when the cursor is moved out of a field or memory variable even if no changes were made to the field or memory variable. The REQUIRED clause is ignored in FoxPro.

RESOLUTION

This is a known incompatibility for which a workaround has not been established.

MORE INFORMATION

Steps to Reproduce Problem

Execute the following code in dBASE IV and FoxPro:

   test1 = SPACE(10)
   test2 = SPACE(10)

   @ 10,10 GET test1 VALID myfunc()
   @ 11,10 GET test2

   READ

   FUNCTION myfunc
        ? "In Valid"
   RETURN .T.

When the code is executed, the cursor will be in test1. Press the ENTER key without making any changes to the memory variable. In dBASE IV, the VALID clause will not be executed. In FoxPro, it will be executed.


Additional reference words: FoxMac FoxDos FoxWin 2.60 differences
KBCategory: kbprg kbprb
KBSubcategory: FxinteropDbase


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 28, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.