Article ID: 162076
Article Last Modified on 6/29/2004
-or-
COMPILE <.prg or .mpr filename>
Database containers:
COMPILE DATABASE <Database container (.dbc) name>
Forms:
COMPILE FORM <form (.scx) name>
Class Libraries (this command is new to Visual FoxPro 5.0):
COMPILE CLASSLIB <Class library (.vcx) name>
Reports or labels (these commands are new to Visual FoxPro 5.0):
COMPILE REPORT <report (.frx) name>
COMPILE LABEL <label (.lbx) name>
For more information, view the Visual FoxPro 5.0 Help File for the
above commands.
******************************************************************
* CONVREPO.PRG
*
* Program to compile Visual FoxPro 5.0 .frx or .lbx file to run under
* Visual FoxPro 3.
* This is necessary only if the report or label contains code in
* any of its DataEnvironment methods.
*
* Usage: DO CONVREPO WITH <.frx or .lbx file including extension>
*
* Example: DO CONVREPO WITH "myreport.frx"
*
******************************************************************
LPARAMETER lcFrxName
LOCAL lcAlias, lcTmpFile
IF (TYPE('lcFrxName') = "C" AND UPPER('frx')$UPPER(lcFrxName)) OR ;
(TYPE('lcFrxName') = "C" AND UPPER('lbx')$UPPER(lcFrxName))
IF NOT FILE(lcFrxName)
=MESSAGEBOX('The file '+ UPPER(lcFrxName) + ' does not ' + ;
'exist in the default directory. '+ CHR(13)+ ;
'Please pass a valid report '+ ;
'or label filename, including extension, to this program!' ;
,48, "Report/Label Code Compiler")
RETURN
ENDIF
USE (lcFrxName)
lcAlias = ALIAS()
* Look for any Data Environment object's records
SCAN FOR NAME='dataenvironment' ;
OR NAME='cursor' ;
OR NAME='relation'
IF !EMPTY(TAG) && Is there any code?
lcTmpFile = SYS(3)
COPY MEMO TAG TO (lcTmpFile+'.PRG') && Copy to temp .prg
COMPILE (lcTmpFile) && Compile it
APPEND MEMO tag2 ;
FROM (lcTmpFile+".FXP") OVERWRITE && Write it back to .frx/.lbx
ERASE (lcTmpFile+".PRG") && Delete temp files
ERASE (lcTmpFile+".FXP")
ENDIF
ENDSCAN
USE IN (lcAlias)
SET MESSAGE TO "Recompile completed"
WAIT "" TIMEOUT 2
SET MESSAGE TO
ELSE
=MESSAGEBOX('Please pass a report or label filename, '+ ;
'including extension, to this program!' ,48, ;
"Report/Label Code Compiler")
RETURN
ENDIF
RETURN
*
* End of CONVREPO.PRG
*
**************************************************************
Attempting to run or modify within Visual FoxPro 3.0 a report or label file
that was compiled in Visual FoxPro 5.0 gives an error such as the
following:
Additional query words: compatibility backward screens
Keywords: kbhowto kbprogramming kb3rdparty kbdisplay KB162076