Skip to content

Using FoxBin2Prg

Rick Boatright edited this page Apr 8, 2017 · 10 revisions

Using the "PRG" version:

<DO FOXBIN2PRG.PRG WITH "<path>\file.scx"> Generates the Text version <DO FOXBIN2PRG.PRG WITH "<path>\file.sc2"> Regenerates the Binary version <DO FOXBIN2PRG.PRG WITH "<path>\proj.pjx", ""> Generates the Text files for all the files in the PJX, including the PJX <DO FOXBIN2PRG.PRG WITH "<path>\proj.pj2", ""> Regenerates the Binary files for all the files in the PJ2 <DO FOXBIN2PRG.PRG WITH "<path>\proj.pjx", "*-"> Generates the Text files for all the files in the PJX, excluding the PJX <DO FOXBIN2PRG.PRG WITH "<path>\file.vcx::cus_client"> Regenerates only the Text version of the individual class cus_client of file.vcx (with UseClassPerFile:1 or 2)

Using the "Object" version:

*-- Instancing directly from the EXE (fastest way, only EXE needed) LOCAL loCnv AS c_foxbin2prg OF "FOXBIN2PRG.PRG" SET PROCEDURE TO "<Path>\FOXBIN2PRG.EXE" loCnv = CREATEOBJECT("c_foxbin2prg") loCnv.execute( <params> )

-or this way also-

-- Instancing from the PRG (you also need various files, like the 27 props.txt) LOCAL loCnv AS c_foxbin2prg OF "FOXBIN2PRG.PRG" loCnv = NEWOBJECT("c_foxbin2prg", "<Path>\FOXBIN2PRG.PRG") loCnv.execute( <params> )

Syntax:
There are some differences in the parameters when you call foxBin2prg.exe from the outside (with RUN or from another EXE), or when using it as an object and work directly with the "execute" method, which is more flexible and has more options:

EXE/objectParametersReturn value

FoxBin2Prg.EXE cInputFile [,cType [,cTextName [,lGenText [,cDontShowErrors [,cDebug [,cDontShowProgress [,cOriginalFileName [,cRecompile [,cNoTimestamps [,cCFG_File] ] ] ] ] ] ] ] ] ] ErrorLevel 0=OK, 1=ERR

obj.execute() cInputFile [,cType [,cTextName [,lGenText [,cDontShowErrors [,cDebug [,cDontShowProgress [,oModule [,oEx [,lRelanzarError [,cOriginalFileName [,cRecompile [,cNoTimestamps [,cBackupLevels [,cClearUniqueID [,cOptimizeByFilestamp [,cCFG_File] ] ] ] ] ] ] ] ] ] ] ] ] ] ] 0=OK, num=VFP Error code

Note: When using the EXE, if using any combination of ("BIN2PRG", "PRG2BIN", "INTERACTIVE", "SHOWMSG") separated by a "-", cType and cInputFile parameters can be swapped. This is useful when dealing with Windows shortcuts, on which fixed parameters must be in the shortcut and the filename is an external variable parameter received when SendingTo FoxBin2Prg with right-click on File Manager.

<params> are:Param.Type and Description (!=Required | ?=Optional) (@=by reference | v=by value), (IN/OUT)

cInputFile (v! IN ) Path+Filename of the file to convert, or Path+Filename::classname for generating individual class with UseClassPerFile:1 or 2. For VSS compatibility, can have a cType letter to query the support type.

cType (v? IN ) For VSS compatibility, indicates the file type (d=DBC, D=DBF, K=Form, B=Label, M=Menu, R=Report, V=Class), -or- indicates some extra combinable options separated by "-" => "BIN2PRG-PRG2BIN-INTERACTIVE-SHOWMSG" -or- can be a "*" (only when cInputFile is a PJX/PJ2) which indicates that all project files must be processed

cTextName (v? IN ) For VSS compatibility, name of the Text version of the file

lGenText (v? IN ) For VSS compatibility, .T.=Generate Text, .F.=Generate Binary. Note: cType have predominance over lGenText

cDontShowErrors (v? IN ) '1' for NOT showing errors with MESSAGEBOX

cDebug (v? IN ) '1' for debugging on the error point (just development mode)

cDontShowProgress (v? IN ) '1' for NOT showing the progress bar

cOriginalFileName (v? IN ) For cases when inputFile is a temp name and you want the correct original name (for example: inside PJ2 files and headers)

cRecompile (v? IN ) If a Path is provided, the binary is recompiled from it. If called from SCCAPI, it's True, else it's False

oModulo (@? OUT) Internal use for Unit Testing

oEx (@? OUT) Exception object

cNoTimestamps (v? IN ) '1' or empty for clearing timestamp, '0' for not clearing it

cBackupLevels (v? IN ) Number of backup levels for converted files. '0'=No backups, default is '1' .bak

cClearUniqueID (v? IN ) '1' or empty for clearing UIDs inside tx2, '0' for not clearing it. Default is '1'

cOptimizeByFilestamp (v? IN ) '1' for not regenerating target file when its timestamp is greater than source file. Default is '0' (disabled)

cCFG_File (v? IN ) Allow specifying a CFG in a special directory

Clone this wiki locally