ID: Q125199
The information in this article applies to:
The Find dialog (CTRL+F) within an EDIT region does not behave the same way in FoxPro for Windows or FoxPro for Macintosh as it does in FoxPro for MS-DOS. If you press CTRL+F while at the beginning of an @...EDIT region and then press CTRL+W or click the FIND button, FoxPro appears to perform the FIND but then immediately proceeds to exit the field.
This behavior occurs whether or not the string was found. The preferred behavior would be for FoxPro to perform the FIND and remain within the EDIT region, either highlighting the string, if it was found, or otherwise sitting at the beginning of the EDIT region -- as it does in FoxPro for MS-DOS.
Either click or tab to the EDIT region again and choose FIND AGAIN (CTRL+G) from the Edit menu to find the string.
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
This example uses the SALESMAN database located within the \TUTORIAL sub- directory of FoxPro. However, no database is necessary to reproduce the problem. Variables may be substituted for the fields below with the same result.
1. Create a new program containing the following code, and save it as
TEST.PRG:
CLOSE ALL
USE salesman
DEFINE WINDOW test AT 0,0 SIZE 22.000,98.400 ;
FONT "MS Sans Serif", 8 FLOAT NOCLOSE MINIMIZE SYSTEM
ACTIVATE WINDOW test
@ 2.846,10.000 GET salesman SIZE 1.000,23.300 DEFAULT " " ;
FONT "MS Sans Serif", 8 PICTURE "@K" WHEN xwhen() ;
VALID xval()
@ 6.538,10.000 EDIT notes SIZE 9.000,79.000,0.000 PICTURE "@K" ;
DEFAULT " " FONT "MS Sans Serif", 8 SCROLL WHEN ywhen() ;
VALID yval()
READ CYCLE
FUNCTION xwhen && field 1 (salesman) when
WAIT WINDOW "in when of field 1"
FUNCTION ywhen && field 2 (notes) when
WAIT WINDOW "in when of field 2"
FUNCTION xval && field 1 (salesman) valid
WAIT WINDOW "in valid of field 1"
FUNCTION yval && field 2 (notes) valid
WAIT WINDOW "in valid of field 2"
2. Run the program by issuing the DO TEST.PRG command.
3. Press the space bar on the WAIT WINDOW from the WHEN clause of
field 1.
4. Press TAB to move to field 2.
5. Press the space bar on the WAIT WINDOW for the VALID clause of field 1
and the WHEN clause of field 2.
6. Once in the EDIT region, press CTRL+HOME to put the cursor at the
beginning of the field. Press CTRL+F to bring up the FIND dialog. Type
in the word 'salesperson' (or any other word listed in the EDIT region).
Then click the FIND button or press CTRL+W to begin the search. In
FoxPro for Windows, the string will be briefly highlighted and then the
WAIT WINDOW for field 2's VALID will appear followed by the WHEN clause
for field 1. FoxPro for Macintosh exhibits the same behavior, however
the string when found, will not be highlighted.
Additional reference words: FoxWin FoxMac 2.60a buglist2.60a
KBCategory: kbprg kbbuglist
KBSubcategory: FxprgGeneral
Last Reviewed: June 27, 1995