How to Convert a FoxPro 2.5 Report File to 2.0 Format

Last reviewed: April 18, 1995
Article ID: Q113523
The information in this article applies to:
  • Microsoft FoxPro for MS-DOS, versions 2.0, 2.5a, 2.5b, and 2.6

SUMMARY

The sample program below will convert a FoxPro 2.5 report file (.FRX) to FoxPro 2.0 format without destroying the original FoxPro 2.5 report file.

MORE INFORMATION

The following sample program converts a FoxPro 2.5 report (RPT25.FRX) to a valid FoxPro 2.0 report (RPT20.FRX).

   PROCEDURE cnvt2025
   PARAMETER output, input
   *  Add .FRX extension to report filename if not present
   IF .NOT. LIKE("*FRX",UPPER(output))
      output = output+".FRX"
   ENDIF
   IF .NOT. LIKE("*FRX",UPPER(input))
      input = input+".FRX"
   ENDIF
   * Store alias of input report database
   USE (input)
   m.alias = ALIAS()
   * Selects only records pertaining to the MS-DOS platform
   SELECT * FROM (input) INTO TABLE tempfrx WHERE platform = "DOS"
   * Creates database with 2.0 structure
   CREATE TABLE (output) ;
      (objtype N(2,0), objcode N(2,0), name M, expr M, ;
      vpos N(4,0), hpos N(4,0), height N(3,0), width N(3,0), ;
      style M, picture M, order M, unique L, comment M, ;
      environ L, boxchar C(1), fillchar C(1), tag M, ;
      tag2 M, float L, stretch L, norepeat L, resetrpt N(2,0), ;
      pagebreak L, resetpage L, ;
      swapheader L, swapfooter L, ejectbefor L, ejectafter L, ;
      plain L, summary L, addalias L, offset N(3,0), ;
      topmargin N(3,0), botmargin N(3,0), totaltype N(2,0),   ;
      resettotal N(2,0) )
   * Copies data to new .FRX file
   APPEND FROM tempfrx
   * Changes version to 2.0 version number
   REPLACE objcode WITH 0 FOR objtype = 1
   USE
   * Turn off SAFETY setting to prepare to delete temporary database
   oldsaf = SET("SAFETY")
   SET SAFETY OFF
   * Delete temporary database
   SELECT tempfrx
   USE
   ERASE tempfrx.DBF
   * Close original report database
   SELECT (m.alias)
   USE
   * Restore SAFETY setting
   SET SAFETY &oldsaf

The program is called as follows, assuming RPT25.FRX is the 2.5 report and RPT20.FRX is the 2.0 report:

   =cnvt2025("rpt20.frx","rpt25.frx")

REFERENCES

"Update Manual," version 2.5, pages 4-14 to 4-17 "Developer's Guide," version 2.0, pages B-14 to B-15


Additional reference words: FoxDos 2.00 2.50 2.50a 2.50b
KBCategory: kbprg kbcode
KBSubcategory:


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: April 18, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.