Microsoft KB Archive/92344

{| = GET Command VALID Clause UDF Executed For Each Entry =
 * width="100%"|

ID: Q92344

The information in this article applies to:


 * Microsoft FoxBASE+ for MS-DOS, version 2.1
 * Microsoft FoxPro for MS-DOS, versions 1.02, 2.0, 2.5, and 2.5a
 * Microsoft FoxPro for Windows, versions 2.5 and 2.5a

SUMMARY
When a GET statement VALID clause contains a user-defined function (UDF), the UDF is executed each time the user leaves the field.

MORE INFORMATION
The following code illustrates that a VALID clause UDF is executed each time the user leaves the field. After creating the two files below, enter DO TEST.PRG at the dot prompt. The code demonstrates that whenever the user presses TAB or ENTER to move to the next GET field, the UDF executes, even when the user does not change the value of the &quot;num2&quot; field from zero.

* TEST.PRG CLEAR SET TALK OFF STORE 0 TO num1,num2,num3 @3,10 SAY &quot;NUMBER 1: &quot; GET num1 @5,10 SAY &quot;NUMBER 2: &quot; GET num2 VALID myudf @7,10 SAY &quot;NUMBER 3: &quot; GET num3 READ SAVE

* MYUDF.PRG PUBLIC mreturn mreturn=.F.  @15,15 SAY &quot;IN MYUDF                            &quot; IF num2<>0 @15,26 SAY &quot;AND VALUE CHANGED FROM ZERO&quot; mreturn=.T.  ENDIF RETURN mreturn Additional reference words: FoxWin FoxDos 2.10 2.00 2.50 2.50A 2.x fox base KBCategory: kbprg KBSubcategory:FxprgGeneral
 * }