How to Implement CTRL+G Functionality to "Find Again"Last reviewed: July 28, 1995Article ID: Q132357 |
The information in this article applies to:
SUMMARYThis article shows by example how to find another occurrence of a string in a file (Find Again) when the CTRL+G key combination is pressed.
MORE INFORMATIONIn FoxPro version 2.x, the Find dialog is activated by pressing CTRL+F. To find another occurrence of a string in a text file, you can press CTRL+G key, and a new search is performed. Visual FoxPro uses a Find dialog common to Windows-based applications on a specific platform. With this dialog, pressing CTRL+G no longer performs a "Find Again" operation. You can, however, program this functionality by explicitly calling the Find window when CTRL+G is pressed.
Step-by-Step ExampleThe following example code illustrates this method. To execute the sample code, follow these steps:
Code Sample* : Find Again for Visual FoxPro using Ctrl+G. * Parameter List....: tlFindMode *-- To execute Find Again, press {Ctrl+G}. LPARAMETERS tlFindMode LOCAL lcDoCommand *-- If not find mode, initialize {Ctrl+G}. IF NOT tlFindMode lcDoCommand='DO '+SYS(16)+' WITH .T.' ON KEY LABEL Ctrl+G &lcDoCommand RETURNENDIF *-- If Find dialog is not active, stuff keyboard with {Ctrl+F} and * stuff {ENTER} in keyboard to execute Find. IF NOT WEXIST('Find') KEYBOARD '{Ctrl+F}{ENTER}' PLAIN RETURNENDIF *-- Activate Find dialog window and stuff {ENTER} in keyboard to * execute Find. ACTIVATE WINDOW Find KEYBOARD '{ENTER}' PLAIN RETURN
|
Additional reference words: 3.00 COMMDLG VFoxWin
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |