How to Display the Page Number of a FoxPro for MS-DOS Report

Last reviewed: November 16, 1995
Article ID: Q125518
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

  • 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


    THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

    Last reviewed: November 16, 1995
    © 1998 Microsoft Corporation. All rights reserved. Terms of Use.