Skip to content

Using FoxBin2Prg

Fernando D. Bozzo edited this page Jan 27, 2018 · 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:

Call Optons

You can call the EXE with Run or from another program. This is the simplest choice. Alternatively, you can use the execute method of the object, which has more options and finer control.

Call Parameters Return Values
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
other_number=VFP Error code

Note:

When using the EXE, you can use any combination of ("BIN2PRG", "PRG2BIN", "INTERACTIVE", and "SHOWMSG") as the cType parameter. Multiple types are separated by a "-".

The cType and cInputFile parameters order 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.

Parameter Param Type
(v: byValue @: by Reference
Required Description (IN/OUT)
cInputFile v Y 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. IN
cType v N 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- If cInputFile is a PJX/PJ2 the type can be a "*". This which indicates that all project files must be processed. This allows an entire project to be reconstructed from text files with a single command.
IN
cTextName v N Primarily for VSS compatibility, name of the Text version of the file. IN
lGenText v N Primarily for VSS compatibility to accept their parameters.
.T.=Generate Text, .F.=Generate Binary.
Note: the cType parameter has predominance over lGenText
IN
cDontShowErrors v N '1' for NOT showing errors with MESSAGEBOX IN
cDebug v N '1' for debugging on the error point (just development mode) IN
cDontShowProgress v N '1' for NOT showing the progress bar IN
cOriginalFileName v N For cases when inputFile is a temp name and you want the correct original name (for example: inside PJ2 files and headers) IN
cRecompile v N If a Path is provided, the binary is recompiled from it. If called from SCCAPI, it's True, else it's False IN
oModulo @ N Internal use for Unit Testing OUT
oEx @ N Exception object OUT
cNoTimestamps v N '1' or empty for clearing timestamp, '0' for not clearing it IN
cBackupLevels v N Number of backup levels for converted files. '0'=No backups, default is '1' .bak IN
cClearUniqueID v N '1' or empty for clearing UIDs inside tx2, '0' for not clearing it. Default is '1' IN
cOptimizeByFilestamp v N '1' for not regenerating target file when its timestamp is greater than source file. Default is '0' (disabled) IN
cCFG_File v N Allow specifying a CFG in a special directory IN