-
Notifications
You must be signed in to change notification settings - Fork 36
Using FoxBin2Prg
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:
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-
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:
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.
<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