How to Create an Interruptible Report in Microsoft FoxProLast reviewed: January 26, 1996Article ID: Q89146 |
The information in this article applies to:
To allow the user to interrupt generating a report, place a user-defined function (UDF) as a field object in the Detail band of the report. For example, if you want to create a UDF to interrupt a report, place a field named STOP() on the Detail line of the report. Then create the following program named STOP.PRG in the same directory as your report:
** STOP.PRG SET TALK OFF IF CHRSAW() WAIT CLEAR IF LASTKEY()=13 SET TYPEAHEAD to 0 DEFINE WINDOW stopit FROM 10,10 TO 14,60 DOUBLE ACTIVATE WINDOW stopit x=0 @ 1,5 SAY "Stop printing report" GET x ; PICTURE "@*H Yes ; No" READ IF x=1 GO BOTTOM ENDIF ENDIF DEACTIVATE WINDOW stopit ENDIF SET TALK ON SET TYPEAHEAD TO 20 RETURN ""NOTE: SET TYPEAHEAD prevents FoxPro from referring to the ENTER key already in the keyboard buffer (the print action calls the Print dialog box with the PROMPT command). The first time you run the code, you must press the ESC key to cancel printing. The second time, and every time therefter, if you press ENTER when the report is in process, a dialog box prompts you for the appropriate action.
|
Additional reference words: FoxDos 2.00 2.50 2.50a 2.50b cancel quit exit
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |