Microsoft KB Archive/121630

PRB: Clicking Object with Mouse Terminates READ

PSS ID Number: Q121630 Article last modified on 08-28-1995

2.5x 2.60 2.60a 3.00| 2.00 2.50x 2.60 2.60a | 2.5x 2.60a

WINDOWS | MS-DOS | MACINTOSH

= SYMPTOMS =

If the mouse is used to activate an object that is disabled by the VALID clause of the previously active object, the current READ is terminated.

NOTE: If the keyboard is used instead of the mouse to activate the object, the READ is not terminated.

= CAUSE =

The mouse click invokes the VALID clause of the previous object, which attempts to disable the object that has already been clicked. FoxPro handles this condition by terminating the READ.

= RESOLUTION =

Issue the READ from within a DO WHILE loop, as in the code example below:

SET READBORDER ON DEFINE WINDOW test FROM 1,1 to 10,30 DOUBLE SHADOW ACTIVATE WINDOW test MOVE WINDOW test CENTER m.choice1 = SPACE(10) m.choice2 = SPACE(10) m.choice3 = SPACE(10) llLeave = .F. lnObject = 0

@ 0, 10 GET m.choice1 VALID valclause WHEN wheclause @ 2, 10 GET m.choice2 @ 4,10 GET m.choice3 PICTURE “@* OK” VALID termrd

DO WHILE !llLeave READ CYCLE SAVE OBJECT lnObject ENDDO

CLEAR GETS RELEASE WINDOW test

FUNCTION valClause SHOW GET m.choice2 DISABLE

FUNCTION wheclause lnObject = _CUROBJ

FUNCTION termrd llLeave = .T. CLEAR READ

= STATUS =

This behavior is by design. This behavior was modified in Visual FoxPro for Windows, version 3.0.

= MORE INFORMATION =

Steps to Reproduce Behavior
  Run the following program: DEFINE WINDOW test FROM 1,1 to 10,30 DOUBLE SHADOW ACTIVATE WINDOW test MOVE WINDOW test CENTER m.choice1 = SPACE(10) m.choice2 = SPACE(10) m.choice3 = SPACE(10) @ 0,10 GET m.choice1 VALID valclause @ 2,10 GET m.choice2 @ 4,10 GET m.choice3 READ CYCLE RELEASE WINDOW test FUNCTION valClause SHOW GET m.choice2 DISABLE   Type 123 in the first GET object.   Using the mouse, click the second GET object. 

Note that the READ is terminated, returning you to the Command window.

= REFERENCES =

Code example and resolution provided by Menachem Bazian (FLASH) on CompuServe.

Explanation of behavior provided by Mike Beane on CompuServe.

Additional reference words: FoxMac FoxDos FoxWin 2.50 2.50a 2.50b 2.50c 2.60 2.60a vFoxwin KBCategory: kbprg kbprb kbcode kbtshoot KBSubcategory: FxprgGeneral

=
================================================================

Copyright Microsoft Corporation 1995.