Microsoft KB Archive/125518

{| = How to Display the Page Number of a FoxPro for MS-DOS Report =
 * width="100%"|

ID: Q125518

2.00 2.50 2.50a 2.50b 2.60 2.60a MS-DOS kbtool

The information in this article applies to:


 * Microsoft FoxPro for MS-DOS, versions 2.0, 2.5x, 2.6, 2.6a

SUMMARY
When a report prints in FoxPro for Windows, a Windows dialog box appears and displays the report file name and the page number currently printing. However, no comparable dialog box appears when a report prints in FoxPro for MS-DOS. Creating a simple user defined function (UDF) allows the display of the page number as the report prints.

MORE INFORMATION
The modification of a report to call a UDF is a relatively straight forward process. The following steps outline the process:

1. Type "Modify Format form name" (without the quotation marks) in the

Command window. 2. In the page footer of the report, create a field. In the expression line type showpage. Set the field width to one. 3. Close the REPORT FORM. 4. Type "Modify Command showpage.prg" in the Command window.

5 In the Showpage program, type this command:

WAIT WINDOW "Printing Page" +STR(_pageno) NOWAIT 6. Save the program, and run the report. The WAIT WINDOW NOWAIT command displays the value of the _PAGENO system memory variable without pausing the execution of the REPORT FORMAT command. The STR function converts the numeric _PAGENO variable to a character type.

If the report executes from within a program, the WAIT WINDOWS object remains on the monitor. To clear the wait window from the screen, add the follow line to the program code immediately after the REPORT FORMAT command:

KEYBOARD '{SPACEBAR}' This simulates pressing the space bar and clears the wait window. Additional reference words: FoxDos 2.60 2.60a KBCategory: kbtool KBSubcategory: FxtoolRwriter

Keywords         : FxtoolRwriter Version          : 2.00 2.50 2.50a 2.50b 2.60 2.60a Platform         : MS-DOS
 * }