Microsoft KB Archive/158766

= PRB: VALID Behavior on @..GET Different in Version 5.0 =

Article ID: 158766

Article Last Modified on 12/3/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b Standard Edition
 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 6.0 Professional Edition
 * Microsoft Visual FoxPro 3.0 for Macintosh
 * Microsoft FoxPro 2.5b for Macintosh
 * Microsoft Visual FoxPro 2.5c for Macintosh
 * Microsoft FoxPro 2.6a Professional Edition for Macintosh

-



This article was previously published under Q158766



SYMPTOMS
Visual FoxPro for Windows 3.0x and 5.0 invoke the VALID clause upon execution of a MODIFY MEMO command, whereas FoxPro for Windows 2.6x does not.



WORKAROUND
The suggested workaround is to set a flag based on the version and test the flag prior to executing any Valid code.



STATUS
This behavior is by design.



MORE INFORMATION
Since Visual FoxPro for Windows is now object-oriented, the Valid event is firing properly. The cursor has indeed left the GET field; therefore, the MODIFY MEMO window now has the focus.

Steps to Reproduce Behavior
Enter and run the following program in both Visual FoxPro 5.0 (or 3.0x) and FoxPro for Windows 2.6x and notice that Visual FoxPro invokes the READ VALID clause, whereas FoxPro for Windows does not. On the Program menu, click Cancel to exit the program: CLEAR ON KEY LABEL f4 DO modiproc

* use a table that has a memo field such as the * \foxprow\tutorial\salesman.dbf or \vfp\samples\data\employee.dbf * execute the following code which creates a Readtest.dbf.

CREATE TABLE ReadTest (char1 C(10), char2 C(10), memo1 M(4)) APPEND BLANK REPLACE memo1 WITH ; "notice that the Wait Window does display in Visual FoxPro" @ 2,2 SAY 'tab into the second get field, then press the F4 key' @ 4,2 GET char1 @ 4,20 GET char2 VALID testvalid READ CLEAR READ

FUNCTION modiproc MODIFY MEMO memo1 RETURN

FUNCTION testvalid  && char2 valid WAIT WINDOW "I am in the valid of the second get" RETURN

Keywords: kbinterop kbprb KB158766

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.