Tha purpose of FoxBin2Prg is to facilitate the Diff and Merge of Visual FoxPro 9 binaries, which are not natively supported by any source control tool. Traditionally FoxPro comes with a tool named SccText.prg who can make a text representation exporting the source code contained in FoxPro tables with a DBF structure. An enhanced version is available on VFPx named SccTextX, but like his ancestor, have some design limitations, as:
FoxBin2Prg is designed to bring a solution for all of this, and a few more things, which makes tx2 (text) files with PRG-style and enhances compatibility with SCCAPI (SourceSafe) and other SCM tools, like PlasticSCM, Git, Subversion, and the like.
Special remark on Merge operation is made, because it is the most difficult and more used operation when working with SCM tools, and this require that generated text files can be manipulated manually or automatically.
TX2 files keep lists of objects and there metadata in a special OBJECTDATA tag, in which the order of the list is the ZOrder of the object, like this example:
This way, you can rearrange the items to alter there ZOrder, and this does auto-renumbering when regenerating binaries.
Starting from v1.19.21 arrays don't need to be preceded with "^" symbol, and methods don't need to be preceded with "*" symbol, whick makes this section more easy to maintain.
- it doesn't generate PRG like code
- It doesn't permit modification of the txa (text) files generated
- txa (text) files generated can't be used for merge with SCM tools
- Timestamps and ZOrder fields generate a lot of unnecesary differences
FoxBin2Prg is designed to bring a solution for all of this, and a few more things, which makes tx2 (text) files with PRG-style and enhances compatibility with SCCAPI (SourceSafe) and other SCM tools, like PlasticSCM, Git, Subversion, and the like.
Special remark on Merge operation is made, because it is the most difficult and more used operation when working with SCM tools, and this require that generated text files can be manipulated manually or automatically.
This are the FoxBin2Prg.cfg configuration file settings and there meaning
FoxBin2Prg.cfg keywords and Defaults | Description |
---|---|
extension: xx2 | FoxBin2Prg extensions ends in '2' (pj2, vc2, sc2, etc), but you can change that. For example you can change pj2 to pja using this: extension: pj2=pja for making it SourceSafe compatible |
DontShowProgress: 0 | By default, a progress bar is shown when processing multiple-files |
DontShowErrors: 0 | By default, show message errors in a modal messagebox. Specify "1" if don't want |
NoTimestamps: 1 | By default, timestamp fields are cleared, because a lot of differencies are generated on binaries and tx2 files with Timestamps activated. This timestamp field is part of the vcx, scx and other Foxpro binary source code files |
Debug: 0 | By default, don't generate individual <file>.Log with process hints. Activate with "1" to find prossible error causes |
ExtraBackupLevels: 1 | By default, 1 .BAK file is created. With this setting you can make more .N.BAK, or none at all with 0 |
ClearUniqueID: 0 | 0=Keep UniqueID, 1=Clear Unique ID. Very useful for Diff and Merge, because a lot of differencies are generated on binaries and tx2 files with UniqueID activated |
XXXConversionSupport: N | 0=No support, 1=Generate TXT only (Diff), 2=Generate TXT and BIN (Merge) |
PJXConversionSupport: 2 | Default value is 2 - Bidirectional (tx2 and bin) support activated |
VCXConversionSupport: 2 | Default value is 2 - Bidirectional (tx2 and bin) support activated |
SCXConversionSupport: 2 | Default value is 2 - Bidirectional (tx2 and bin) support activated |
FRXConversionSupport: 2 | Default value is 2 - Bidirectional (tx2 and bin) support activated |
LBXConversionSupport: 2 | Default value is 2 - Bidirectional (tx2 and bin) support activated |
MNXConversionSupport: 2 | Default value is 2 - Bidirectional (tx2 and bin) support activated |
DBCConversionSupport: 2 | Default value is 2 - Bidirectional (tx2 and bin) support activated |
DBFConversionSupport: 1 | Default value is 1 - just tx2 support activated. The support for regenerating DBFs structures are disabled by default to not overrite data accidentally. When activating bidirectional supoort (2), keep in mind that Data is not restored, just the structure and indexes!. Use with care. |
FoxBin2Prg Internals
ZOrder
In TX2 files and starting from v1.19.12, the ZOrder, that determines the order on which objects are instantiated and which one is on top, is maintained in a more intuitive and optimal way compared to traditional stored numerical values.TX2 files keep lists of objects and there metadata in a special OBJECTDATA tag, in which the order of the list is the ZOrder of the object, like this example:
DEFINE CLASS cnt_controles AS container && Descripción de la clase "cnt_controles" *< CLASSDATA: Baseclass="container" Timestamp="" Scale="Pixels" Uniqueid="" /> *-- OBJECTDATA items order determines ZOrder *< OBJECTDATA: ObjPath="Check2" UniqueID="" Timestamp="" /> *< OBJECTDATA: ObjPath="Check4" UniqueID="" Timestamp="" /> *< OBJECTDATA: ObjPath="Label_h" UniqueID="" Timestamp="" /> *< OBJECTDATA: ObjPath="Textbox_h" UniqueID="" Timestamp="" /> *< OBJECTDATA: ObjPath="Check1" UniqueID="" Timestamp="" /> *< OBJECTDATA: ObjPath="Check3" UniqueID="" Timestamp="" />
This way, you can rearrange the items to alter there ZOrder, and this does auto-renumbering when regenerating binaries.
PAM Section
Ths section is generated for classes and forms, it is delimited with the <DefinedPropArrayMethod> tag, and have the definition of properties, arrays and methods, with there comments, like this example:DEFINE CLASS c1 AS custom OLEPUBLIC && Descripción de la clase "c1" *<DefinedPropArrayMethod> *m: metodovacio_con_comentarios && Este método no tiene código, pero tiene comentarios. A ver que pasa! *m: mimetodo && Mi metodo *p: prop1 && Mi prop 1 *p: prop_especial_cr *p: prop_especial_crlf && Debería tener CR+LF *a: array_1_d[1,0] && Array 1 dimensión (1) *a: array_2_d[1,2] && Array una dimension (1,2) *p: _memberdata && XML Metadata for customizable properties *</DefinedPropArrayMethod>
Starting from v1.19.21 arrays don't need to be preceded with "^" symbol, and methods don't need to be preceded with "*" symbol, whick makes this section more easy to maintain.