How to Revert .SCX/.FRX Files to Pre-Transported State in FPW

Last reviewed: April 30, 1996
Article ID: Q126014
The information in this article applies to:
  • Microsoft FoxPro for Windows, version 2.6a

SUMMARY

When you open a report or screen for editing and that report or screen was created on a platform other than the current one, the Transport program is invoked to add platform specific records to .SCX and .FRX files. Once the platform-specific records have been created and the file modified, there is no intrinsic method to revert back to the original (untransported) form. This article shows by example how to do it using code.

MORE INFORMATION

IMPORTANT NOTE: The techniques described below will *PERMANENTLY* remove all work done under the current platform on the file selected. This measure should only be carried out if attempting to repair the work would be costlier in time and effort than starting over again.

Returning the file to a pre-transported state can be accomplished by opening the .SCX or .FRX with the USE command and deleting the records for the specific platform. However, if there are more than a few files to revert, this method can be time-consuming and cumbersome.

The following program will quickly modify the selected files, while allowing control over the name and type of files selected. If the file has no platform specific records, the system message window will show that the selected file has completed processing, with no error generated.

To display an optional safety message prior to packing the database, remove the asterisks placed in front of the section of code.

   * REVERTER.PRG Removes records of the current platform in SCX or FRX
   *
   * This program assumes a clean environment, so any setup code should go
   * here to preserve open files, status settings, and so on.

   SET MESSAGE TO "Click CANCEL when finished"
   SET TALK OFF
   * Loop through SCX/FRX files to be processed, until CANCEL is pressed:

   DO WHILE LASTKEY() <> 27

       fyl = ( GETFILE( 'SCX;FRX', 'Select a file:', 'Revert' ) )

       * CANCEL button pressed, so exit loop:
       IF !FILE( fyl )
           SET MESSAGE TO ""
           RETURN

       * otherwise, valid SCX/FRX file selected:
       ELSE

           DO CASE   && determine current platform
           CASE AT( "WINDOWS", UPPER( VERSION() ) ) <> 0
               vers = "WINDOWS"
           CASE AT( "MAC", UPPER( VERSION() ) ) <> 0
               vers = "MAC"
           CASE AT( "UNIX", UPPER( VERSION() ) ) <> 0
               vers = "UNIX"
           CASE AT( "FOXPRO", UPPER( VERSION() ) ) <> 0
               vers = "DOS"
           OTHERWISE
               WAIT WINDOW "Unknown platform" NOWAIT
               RETURN
           ENDCASE

           USE ( fyl ) EXCLUSIVE  && must not be in use elsewhere!

           DELETE FOR platform = vers   && marks this platform's records

           *** optional warning message:
           * WAIT WINDOW CHR(13)+"   DELETE RECORDS FOREVER?   "+ ;
           *  CHR(13)+CHR(13)+"               [ Y ]es  or  [ N ]o"+ ;
           *  CHR(13) TO answer
           * IF UPPER(answer)<>"Y"
           *     WAIT WINDOW (fyl) + " skipped." NOWAIT
           *     LOOP   && go back for next file
           * ENDIF

           PACK   && permanently remove records

           * Inform user of progress:
           WAIT WINDOW (fyl) + " completed." NOWAIT

       ENDIF   && end of test for valid filename

   ENDDO   && get next SCX/FRX, or cancel

   SET MESSAGE TO ""    && reset status bar

   *  End of Program


Additional reference words: FoxWin 2.60a undo version redo revert
KBCategory: kbtool kbcode
KBSubcategory: FxtoolSbuilder


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 30, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.