Microsoft KB Archive/114755

{| = PRB: The REQUIRED Clause of VALID Is Not Supported in FoxPro =
 * width="100%"|

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.

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
 * }