fix
This commit is contained in:
@@ -1,428 +1,428 @@
|
||||
# Internals
|
||||
Documentation of FoxBin2Prg - A Binary to Text converter for MS Visual Foxpro 9
|
||||
|
||||
## Purpose of this document
|
||||
This document shows some internal functions and ideas how to use of FoxBin2Prg.
|
||||
|
||||
The original document was created by [Fernando D. Bozzo](https://github.com/fdbozzo) whom I like to thank for the great project.
|
||||
Pictures are taken from the original project.
|
||||
As far as possible these are the original documents. Changes are added where functionality is changed.
|
||||
|
||||
----
|
||||
## Table of contents
|
||||
- [Why to use this tool](#why-to-use-this-tool)
|
||||
- [Configuration file](#configuration-file)
|
||||
- [Configuration file per table](#configuration-file-per-table)
|
||||
- [FoxBin2Prg Internals](#foxbin2prg-internals)
|
||||
- [ZOrder](#zorder)
|
||||
- [RemoveZOrderSetFromProps setting](#removezordersetfromprops-setting)
|
||||
- [VFP ZOrder bug and fix](#vfp-zorder-bug-and-fix)
|
||||
- [DBC ordered fields](#dbc-ordered-fields)
|
||||
- [PAM Section](#pam-section)
|
||||
- [Property Ordering](#property-ordering)
|
||||
- [Timestamps and UniqueIDs](#timestamps-and-uniqueids)
|
||||
- [DBF Data Export/Import for Diff/Merge](#dbf-data-export/import-for-diff/merge)
|
||||
- [Order and range of records](#order-and-range-of-records)
|
||||
- [Configuration per table](#configuration-per-table)
|
||||
- [DBF/DB2 Convertion Hooks](#dbf/db2-convertion-hooks)
|
||||
- [Language Support for messages](#language-support-for-messages)
|
||||
- [Multi-config](#multi-config)
|
||||
- [File Capitalization](#file-capitalization)
|
||||
- [Conversion processes Logging](#conversion-processes-logging)
|
||||
- [Create Class-Per-File](#create-class-per-file)
|
||||
- [Complementary options for the UseClassPerFile setting](#complementary-options-for-the-useclassperfile-setting)
|
||||
- [RedirectClassPerFileToMain:](#redirectclassperfiletomain:)
|
||||
- [ClassPerFileCheck](#classperfilecheck)
|
||||
- [Create File-Per-DBC](#create-file-per-dbc)
|
||||
- [Complementary options for the UseFilesPerDBC setting](#complementary-options-for-the-usefilesperdbc-setting)
|
||||
- [RedirectFilePerDBCToMain](#redirectfileperdbctomain)
|
||||
- [ItemPerDBCCheck](#itemperdbccheck)
|
||||
- [FoxBin2Prg API](#foxbin2prg-api)
|
||||
- [PEM](#pem)
|
||||
- [Renamed](#renamed)
|
||||
- [Log to StdOut](#log-to-stdout)
|
||||
- [How to use with a SCM tool](#how-to-use-with-a-scm-tool)
|
||||
|
||||
## Why to use this tool
|
||||
The 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:
|
||||
|
||||
* It doesn't generate PRG like code
|
||||
* It doesn't allow modification of the txa (text) files generated
|
||||
* Scctext's txa (text) files generated can't be used for merge with SCM tools, they are readonly
|
||||
* Timestamps and ZOrder fields generate a lot of unnecesary differences all over the text file
|
||||
|
||||
FoxBin2Prg is designed to bring a solution for all of this, and a few more things,
|
||||
which makes _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.
|
||||
|
||||
#### Note
|
||||
**You came from Visual SourceSafe and have the .pjm but not the real pjx project?**
|
||||
|
||||
No problem, just convert the .pjm to .pjx/.pjt sending to FoxBin2Prg, and it generates the real project again.
|
||||
|
||||
## Configuration file
|
||||
It is possible to create a template or a config with all options and comments via
|
||||
```
|
||||
DO FOXBIN2PRG.PRG WITH "-c","template.cfg" ==> Generates a template for FoxBin2Prg.cfg config file with newest settings
|
||||
DO FOXBIN2PRG.PRG WITH "-C","config.cfg" ==> Generates a config file like FoxBin2Prg.cfg with recent settings of path of second parameter
|
||||
```
|
||||
See [command line](./FoxBin2Prg_Run.md#usage-2).
|
||||
The config file is used to move local setting to a different comupter or for changes while branching.
|
||||
|
||||
The options in the template (or in the config that ships with FoxBin2Prg) are commented out.
|
||||
To activate an option remove the asterix and set appropriate value.
|
||||
These are the FoxBin2Prg.cfg configuration file settings and their meaning:
|
||||
|
||||
| FoxBin2Prg.cfg keywords | Value (_Default_) | Description |
|
||||
| ----- | ----- | ----- |
|
||||
| extension: xx2 | | FoxBin2Prg extensions ends in '2' (pj2, vc2, sc2, etc), but you can change that.<br/>For example you can change pj2 to pja using this: "extension: pj2=pja" for making it SourceSafe (sccapi v1) compatible.<br/>It could be any pair, used sources are:<br/>pj2, vc2, sc2, fr2, lb2, mn2, db2, dc2, fk2, me2 |
|
||||
| DontShowProgress | 0 | **Deprecated**. Replaced by ShowProgressbar option from v1.19.40 |
|
||||
| ShowProgressbar | 0, _1_, 2 | 1=Always show a progress bar,<br/>2=Only show it when processing multiple-files,<br/>0=Don't show progressbar |
|
||||
| DontShowErrors | _0_, 1 | By default, show message errors in a modal messagebox.<br/>Specify "1" if don't want to show errors |
|
||||
| NoTimestamps | 0, _1_ | By default, timestamp fields are cleared on _Text_ files, because a lot of differencies are generated on _Binaries_ and _Text_ files with Timestamps activated. This timestamp field is part of the vcx, scx and other Foxpro binary source code files |
|
||||
| Debug | _0_, 1, 2 | By default, don't generate individual <file>.Log with process hints.<br/>Activate with "1" to find possible error causes and for debugging,<br/>"2" is special logging |
|
||||
| ExtraBackupLevels | 0, _1_, n | By default, one _filename_.BAK file is created.<br/>With this setting you can make more _filename_.n.BAK files,<br/>or none at all using 0 |
|
||||
| ClearUniqueID | 0, _1_ | 0=Keep UniqueID,<br/>1=Clear Unique ID.<br/>Very useful for Diff and Merge. By default, UniqueID fields are cleared on _Text_ files, because a lot of differencies are generated with UniqueID activated |
|
||||
| OptimizeByFilestamp | _0_, 1 | 0=Don't optimize (always generate),<br/>1=Optimize (generate only when destination filestamp es older). By default this optimization is deactivated, and it is not recommended if using for merge, so _Bin_ and _Text_ files can be modified seperately.<br/><span style="background-color: gold;">Dangerous while working with branches!</span> |
|
||||
| RemoveNullCharsFromCode | 0, _1_ | 1=Drop NULL chars from source code,<br/>0=Leave NULLs in source code |
|
||||
| RemoveZOrderSetFromProps | _0_, 1 | 1=Remove ZOrderSet from the properties,<br/>0=Leave ZOrderSet in the properties |
|
||||
| XXX_Conversion_Support | n | Defines the conversion operation per filetype |
|
||||
| | | For code:<br/> 0=No support,<br/>1=Generate _Text_ (Diff),<br/>2=Generate _Text_ and _Bin_ (Merge) |
|
||||
| | | For complex data:<br/> (PJX / DBC / DBF): 0=No support,<br/>1=Generate Header _Text_ only (Diff),<br/>2=Generate Header _Text_ and _Bin_ (Merge/Only Structure!),<br/>4=Generate _Text_ with DATA (Diff),<br/>8=Export and Import DATA (Merge/Structure & Data) |
|
||||
| PJX_Conversion_Support | 0, 1, _2_ | Default value is 2 - Bidirectional ((Merge/Only Structure!),<br/>4=Generate _Text_ with DATA (Diff), 8=Export and Import DATA (Merge/Structure & Data) and _bin_) support activated |
|
||||
| VCX_Conversion_Support | 0, 1, _2_ | Default value is 2 - Bidirectional (_Text_ and _bin_) support activated |
|
||||
| SCX_Conversion_Support | 0, 1, _2_ | Default value is 2 - Bidirectional (_Text_ and _bin_) support activated |
|
||||
| FRX_Conversion_Support | 0, 1, _2_ | Default value is 2 - Bidirectional (_Text_ and _bin_) support activated |
|
||||
| LBX_Conversion_Support | 0, 1, _2_ | Default value is 2 - Bidirectional (_Text_ and _bin_) support activated |
|
||||
| MNX_Conversion_Support | 0, 1, _2_ | Default value is 2 - Bidirectional (_Text_ and _bin_) support activated |
|
||||
| FKY_Conversion_Support | 0, _1_ | Default value is 1 - _Text_ support activated |
|
||||
| MEM_Conversion_Support | 0, _1_ | Default value is 1 - _Text_ support activated |
|
||||
| DBC_Conversion_Support | 0, 1, _2_ | Default value is 2 - Bidirectional (_Text_ and _bin_) support activated |
|
||||
| DBF_Conversion_Support | 0, _1_, 2, 4, 8 | Default value is 1 - just _Text_ support activated.<br/>The support for regenerating DBFs structures (value = 2) are disabled by default to not overrite data accidentally. When activating bidirectional support, keep in mind that Data is not restored, just the structure and indexes!.<br/>A value of 4 is used to export Structure and Data, but exported data is not imported again.<br/>A value of 8 is used for bidirectional support (No General fields!). <br/> **Note:** This can be [changed per table](#configuration-file-per-table). |
|
||||
| DBF_Conversion_Included | * | If DBF_Conversion_Support:4, you can specify multiple filemasks: www,fb2p_free.dbf.<br/>See [Order and range of records](#order-and-range-of-records). |
|
||||
| DBF_Conversion_Excluded | | If DBF_Conversion_Support:4, you can specify multiple filemasks: www,fb2p_free.dbf.<br/>See [Order and range of records](#order-and-range-of-records). |
|
||||
| OldFilesPerDBC | _0_, 1 | This controls the use of the _UseFilesPerDBC_, _RedirectFilePerDBCToMain_ and _ItemPerDBCCheck_ options.<br/>Only if this option is set, the options will be read. |
|
||||
| | | 0 New version inactive, options follow:<br/>UseFilesPerDBC=UseClassPerFile<br/>RedirectFilePerDBCToMain=RedirectClassPerFileToMain<br/>ItemPerDBCCheck=ClassPerFileCheck |
|
||||
| | | 1 New version active, options active |
|
||||
| | | Note the options will be set to old style, is option is turned off. |
|
||||
| UseFilesPerDBC | _0_, 1 | 0=One database dc2 file, 1=Multiple file.\*.\*.dc2 files.<br/>See [Create File-Per-DBC](#create file-per-dbc)<br/>**Only if OldFilesPerDBC is 1** |
|
||||
| | | 0 creates only a file.dc2 with all DBC (file) data |
|
||||
| | | 1 creates a file.dc2 with DBC properties |
|
||||
| | | and additional DBC files per DBC item (stored-proc, table, ..) |
|
||||
| | | Note: recration only if RedirectFilePerDBCToMain is 1 |
|
||||
| [RedirectFilePerDBCToMain](#redirectfileperdbctomain) | _0_, 1 | 0=Don't redirect to file.dc2,<br/>1=Redirect to file.tx2 when selecting file.item.*.dc2<br/>**Only if OldFilesPerDBC is 1** |
|
||||
| [ItemPerDBCCheck](#itemperdbccheck) | _0_, 1 | 0=Don't check file.item.*.dc2 inclusion,<br/> 1=Check file.item.*.dc2 inclusion<br/>**Only if OldFilesPerDBC is 1**|
|
||||
| DBF_BinChar_Base64 | 0, _1_ | 0=For character type fields, if NoCPTrans 0=do not transform, 1=use Base64 transform (default) <br/> **Note:** This can be [changed per table](#configuration-file-per-table). |
|
||||
| DBF_IncludeDeleted | _0_, 1 | 0=Do not include deleted records (default),<br/>1=Include deleted records<br/>**Note:** This can be [changed per table](#configuration-file-per-table). |
|
||||
| | | **Note:**<br/>This is only true for tables. Generating DBC to _Text_ and back to _Binary_ will act as PACK DATABASE.<br/>The data added by _DBF_IncludeDeleted: 1_ will be ignored by old versions generating _Binary_ files. |
|
||||
| UseClassPerFile | _0_, 1, 2 | 0=One library _Text_ file,<br/>1=Multiple file.class.vc2 files,<br/>2=Multiple file.baseclass.class.vc2 files<br/>See [Create Class-Per-File](#create-class-per-file) |
|
||||
| [RedirectClassPerFileToMain:](#redirectclassperfiletomain:) | _0_, 1 | 0=Don't redirect to file.vc2,<br/>1=Redirect to file.vc2 when selecting file.class.vc2<br/>RedirectClassType: 1 precedes this setting |
|
||||
# Internals
|
||||
Documentation of FoxBin2Prg - A Binary to Text converter for MS Visual Foxpro 9
|
||||
|
||||
## Purpose of this document
|
||||
This document shows some internal functions and ideas how to use of FoxBin2Prg.
|
||||
|
||||
The original document was created by [Fernando D. Bozzo](https://github.com/fdbozzo) whom I like to thank for the great project.
|
||||
Pictures are taken from the original project.
|
||||
As far as possible these are the original documents. Changes are added where functionality is changed.
|
||||
|
||||
----
|
||||
## Table of contents
|
||||
- [Why to use this tool](#why-to-use-this-tool)
|
||||
- [Configuration file](#configuration-file)
|
||||
- [Configuration file per table](#configuration-file-per-table)
|
||||
- [FoxBin2Prg Internals](#foxbin2prg-internals)
|
||||
- [ZOrder](#zorder)
|
||||
- [RemoveZOrderSetFromProps setting](#removezordersetfromprops-setting)
|
||||
- [VFP ZOrder bug and fix](#vfp-zorder-bug-and-fix)
|
||||
- [DBC ordered fields](#dbc-ordered-fields)
|
||||
- [PAM Section](#pam-section)
|
||||
- [Property Ordering](#property-ordering)
|
||||
- [Timestamps and UniqueIDs](#timestamps-and-uniqueids)
|
||||
- [DBF Data Export/Import for Diff/Merge](#dbf-data-export/import-for-diff/merge)
|
||||
- [Order and range of records](#order-and-range-of-records)
|
||||
- [Configuration per table](#configuration-per-table)
|
||||
- [DBF/DB2 Convertion Hooks](#dbf/db2-convertion-hooks)
|
||||
- [Language Support for messages](#language-support-for-messages)
|
||||
- [Multi-config](#multi-config)
|
||||
- [File Capitalization](#file-capitalization)
|
||||
- [Conversion processes Logging](#conversion-processes-logging)
|
||||
- [Create Class-Per-File](#create-class-per-file)
|
||||
- [Complementary options for the UseClassPerFile setting](#complementary-options-for-the-useclassperfile-setting)
|
||||
- [RedirectClassPerFileToMain:](#redirectclassperfiletomain:)
|
||||
- [ClassPerFileCheck](#classperfilecheck)
|
||||
- [Create File-Per-DBC](#create-file-per-dbc)
|
||||
- [Complementary options for the UseFilesPerDBC setting](#complementary-options-for-the-usefilesperdbc-setting)
|
||||
- [RedirectFilePerDBCToMain](#redirectfileperdbctomain)
|
||||
- [ItemPerDBCCheck](#itemperdbccheck)
|
||||
- [FoxBin2Prg API](#foxbin2prg-api)
|
||||
- [PEM](#pem)
|
||||
- [Renamed](#renamed)
|
||||
- [Log to StdOut](#log-to-stdout)
|
||||
- [How to use with a SCM tool](#how-to-use-with-a-scm-tool)
|
||||
|
||||
## Why to use this tool
|
||||
The 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:
|
||||
|
||||
* It doesn't generate PRG like code
|
||||
* It doesn't allow modification of the txa (text) files generated
|
||||
* Scctext's txa (text) files generated can't be used for merge with SCM tools, they are readonly
|
||||
* Timestamps and ZOrder fields generate a lot of unnecesary differences all over the text file
|
||||
|
||||
FoxBin2Prg is designed to bring a solution for all of this, and a few more things,
|
||||
which makes _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.
|
||||
|
||||
#### Note
|
||||
**You came from Visual SourceSafe and have the .pjm but not the real pjx project?**
|
||||
|
||||
No problem, just convert the .pjm to .pjx/.pjt sending to FoxBin2Prg, and it generates the real project again.
|
||||
|
||||
## Configuration file
|
||||
It is possible to create a template or a config with all options and comments via
|
||||
```
|
||||
DO FOXBIN2PRG.PRG WITH "-c","template.cfg" ==> Generates a template for FoxBin2Prg.cfg config file with newest settings
|
||||
DO FOXBIN2PRG.PRG WITH "-C","config.cfg" ==> Generates a config file like FoxBin2Prg.cfg with recent settings of path of second parameter
|
||||
```
|
||||
See [command line](./FoxBin2Prg_Run.md#usage-2).
|
||||
The config file is used to move local setting to a different comupter or for changes while branching.
|
||||
|
||||
The options in the template (or in the config that ships with FoxBin2Prg) are commented out.
|
||||
To activate an option remove the asterix and set appropriate value.
|
||||
These are the FoxBin2Prg.cfg configuration file settings and their meaning:
|
||||
|
||||
| FoxBin2Prg.cfg keywords | Value (_Default_) | Description |
|
||||
| ----- | ----- | ----- |
|
||||
| extension: xx2 | | FoxBin2Prg extensions ends in '2' (pj2, vc2, sc2, etc), but you can change that.<br/>For example you can change pj2 to pja using this: "extension: pj2=pja" for making it SourceSafe (sccapi v1) compatible.<br/>It could be any pair, used sources are:<br/>pj2, vc2, sc2, fr2, lb2, mn2, db2, dc2, fk2, me2 |
|
||||
| DontShowProgress | 0 | **Deprecated**. Replaced by ShowProgressbar option from v1.19.40 |
|
||||
| ShowProgressbar | 0, _1_, 2 | 1=Always show a progress bar,<br/>2=Only show it when processing multiple-files,<br/>0=Don't show progressbar |
|
||||
| DontShowErrors | _0_, 1 | By default, show message errors in a modal messagebox.<br/>Specify "1" if don't want to show errors |
|
||||
| NoTimestamps | 0, _1_ | By default, timestamp fields are cleared on _Text_ files, because a lot of differencies are generated on _Binaries_ and _Text_ files with Timestamps activated. This timestamp field is part of the vcx, scx and other Foxpro binary source code files |
|
||||
| Debug | _0_, 1, 2 | By default, don't generate individual <file>.Log with process hints.<br/>Activate with "1" to find possible error causes and for debugging,<br/>"2" is special logging |
|
||||
| ExtraBackupLevels | 0, _1_, n | By default, one _filename_.BAK file is created.<br/>With this setting you can make more _filename_.n.BAK files,<br/>or none at all using 0 |
|
||||
| ClearUniqueID | 0, _1_ | 0=Keep UniqueID,<br/>1=Clear Unique ID.<br/>Very useful for Diff and Merge. By default, UniqueID fields are cleared on _Text_ files, because a lot of differencies are generated with UniqueID activated |
|
||||
| OptimizeByFilestamp | _0_, 1 | 0=Don't optimize (always generate),<br/>1=Optimize (generate only when destination filestamp es older). By default this optimization is deactivated, and it is not recommended if using for merge, so _Bin_ and _Text_ files can be modified seperately.<br/><span style="background-color: gold;">Dangerous while working with branches!</span> |
|
||||
| RemoveNullCharsFromCode | 0, _1_ | 1=Drop NULL chars from source code,<br/>0=Leave NULLs in source code |
|
||||
| RemoveZOrderSetFromProps | _0_, 1 | 1=Remove ZOrderSet from the properties,<br/>0=Leave ZOrderSet in the properties |
|
||||
| XXX_Conversion_Support | n | Defines the conversion operation per filetype |
|
||||
| | | For code:<br/> 0=No support,<br/>1=Generate _Text_ (Diff),<br/>2=Generate _Text_ and _Bin_ (Merge) |
|
||||
| | | For complex data:<br/> (PJX / DBC / DBF): 0=No support,<br/>1=Generate Header _Text_ only (Diff),<br/>2=Generate Header _Text_ and _Bin_ (Merge/Only Structure!),<br/>4=Generate _Text_ with DATA (Diff),<br/>8=Export and Import DATA (Merge/Structure & Data) |
|
||||
| PJX_Conversion_Support | 0, 1, _2_ | Default value is 2 - Bidirectional ((Merge/Only Structure!),<br/>4=Generate _Text_ with DATA (Diff), 8=Export and Import DATA (Merge/Structure & Data) and _bin_) support activated |
|
||||
| VCX_Conversion_Support | 0, 1, _2_ | Default value is 2 - Bidirectional (_Text_ and _bin_) support activated |
|
||||
| SCX_Conversion_Support | 0, 1, _2_ | Default value is 2 - Bidirectional (_Text_ and _bin_) support activated |
|
||||
| FRX_Conversion_Support | 0, 1, _2_ | Default value is 2 - Bidirectional (_Text_ and _bin_) support activated |
|
||||
| LBX_Conversion_Support | 0, 1, _2_ | Default value is 2 - Bidirectional (_Text_ and _bin_) support activated |
|
||||
| MNX_Conversion_Support | 0, 1, _2_ | Default value is 2 - Bidirectional (_Text_ and _bin_) support activated |
|
||||
| FKY_Conversion_Support | 0, _1_ | Default value is 1 - _Text_ support activated |
|
||||
| MEM_Conversion_Support | 0, _1_ | Default value is 1 - _Text_ support activated |
|
||||
| DBC_Conversion_Support | 0, 1, _2_ | Default value is 2 - Bidirectional (_Text_ and _bin_) support activated |
|
||||
| DBF_Conversion_Support | 0, _1_, 2, 4, 8 | Default value is 1 - just _Text_ support activated.<br/>The support for regenerating DBFs structures (value = 2) are disabled by default to not overrite data accidentally. When activating bidirectional support, keep in mind that Data is not restored, just the structure and indexes!.<br/>A value of 4 is used to export Structure and Data, but exported data is not imported again.<br/>A value of 8 is used for bidirectional support (No General fields!). <br/> **Note:** This can be [changed per table](#configuration-file-per-table). |
|
||||
| DBF_Conversion_Included | * | If DBF_Conversion_Support:4, you can specify multiple filemasks: www,fb2p_free.dbf.<br/>See [Order and range of records](#order-and-range-of-records). |
|
||||
| DBF_Conversion_Excluded | | If DBF_Conversion_Support:4, you can specify multiple filemasks: www,fb2p_free.dbf.<br/>See [Order and range of records](#order-and-range-of-records). |
|
||||
| OldFilesPerDBC | _0_, 1 | This controls the use of the _UseFilesPerDBC_, _RedirectFilePerDBCToMain_ and _ItemPerDBCCheck_ options.<br/>Only if this option is set, the options will be read. |
|
||||
| | | 0 New version inactive, options follow:<br/>UseFilesPerDBC=UseClassPerFile<br/>RedirectFilePerDBCToMain=RedirectClassPerFileToMain<br/>ItemPerDBCCheck=ClassPerFileCheck |
|
||||
| | | 1 New version active, options active |
|
||||
| | | Note the options will be set to old style, is option is turned off. |
|
||||
| UseFilesPerDBC | _0_, 1 | 0=One database dc2 file, 1=Multiple file.\*.\*.dc2 files.<br/>See [Create File-Per-DBC](#create file-per-dbc)<br/>**Only if OldFilesPerDBC is 1** |
|
||||
| | | 0 creates only a file.dc2 with all DBC (file) data |
|
||||
| | | 1 creates a file.dc2 with DBC properties |
|
||||
| | | and additional DBC files per DBC item (stored-proc, table, ..) |
|
||||
| | | Note: recration only if RedirectFilePerDBCToMain is 1 |
|
||||
| [RedirectFilePerDBCToMain](#redirectfileperdbctomain) | _0_, 1 | 0=Don't redirect to file.dc2,<br/>1=Redirect to file.tx2 when selecting file.item.*.dc2<br/>**Only if OldFilesPerDBC is 1** |
|
||||
| [ItemPerDBCCheck](#itemperdbccheck) | _0_, 1 | 0=Don't check file.item.*.dc2 inclusion,<br/> 1=Check file.item.*.dc2 inclusion<br/>**Only if OldFilesPerDBC is 1**|
|
||||
| DBF_BinChar_Base64 | 0, _1_ | 0=For character type fields, if NoCPTrans 0=do not transform, 1=use Base64 transform (default) <br/> **Note:** This can be [changed per table](#configuration-file-per-table). |
|
||||
| DBF_IncludeDeleted | _0_, 1 | 0=Do not include deleted records (default),<br/>1=Include deleted records<br/>**Note:** This can be [changed per table](#configuration-file-per-table). |
|
||||
| | | **Note:**<br/>This is only true for tables. Generating DBC to _Text_ and back to _Binary_ will act as PACK DATABASE.<br/>The data added by _DBF_IncludeDeleted: 1_ will be ignored by old versions generating _Binary_ files. |
|
||||
| UseClassPerFile | _0_, 1, 2 | 0=One library _Text_ file,<br/>1=Multiple file.class.vc2 files,<br/>2=Multiple file.baseclass.class.vc2 files<br/>See [Create Class-Per-File](#create-class-per-file) |
|
||||
| [RedirectClassPerFileToMain:](#redirectclassperfiletomain:) | _0_, 1 | 0=Don't redirect to file.vc2,<br/>1=Redirect to file.vc2 when selecting file.class.vc2<br/>RedirectClassType: 1 precedes this setting |
|
||||
| RedirectClassType | _0_, 1, 2 | For classes created with UseClassPerFile>0 in the form file[.baseclass].class.tx2 (vcx only) |
|
||||
| | | 0 creates / refresh class in file.VCX and add / replace all other classes of this library |
|
||||
| | | 1 creates / refresh class file[.baseclass].class.VCX and do not touch file.VCX |
|
||||
| | | 2 creates / refresh class in file.VCX and do not touch other classes of file.VCX |
|
||||
| [ClassPerFileCheck](#classperfilecheck) | _0_, 1 | 0=Don't check file.class.vc2 inclusion,<br/>1=Check file.class.vc2 inclusion<br/>Only used if import file is in file[.baseclass].class.tx2 syntax.<br/>Ignored for RedirectClassType: 2 |
|
||||
| [ClassPerFileCheck](#classperfilecheck) | _0_, 1 | 0=Don't check file.class.vc2 inclusion,<br/>1=Check file.class.vc2 inclusion<br/>Only used if import file is in file[.baseclass].class.tx2 syntax.<br/>Ignored for RedirectClassType: 2 |
|
||||
| ClearDBFLastUpdate | 0, _1_ | 0=Keep DBF LastUpdate, 1=Clear DBF LastUpdate. Useful for Diff, minimizes differences. |
|
||||
| Language | _(auto)_, EN, FR, ES, DE | Language of templates, shown messages and LOGs. EN=English, FR=French, ES=Español, DE=German, Not defined = AUTOMATIC (using VERSION(3)) ||
|
||||
| HomeDir | 0, _1_ | 0=don't save HomeDir in PJ2,<br/>1=save HomeDir in PJ2.<br/>Setting this to 0 prevents the PJ2 file from changing just because two developers have the project in different folders |
|
||||
|
||||
### Note
|
||||
The options will be read outside in, top to down. See [Multi-config](#multi-config)
|
||||
|
||||
## Configuration file per table
|
||||
Those configuration files are valid for a single table only. The idea is to have special settings for single tables.
|
||||
It is possible to create a template with all options and comments via
|
||||
```
|
||||
DO FOXBIN2PRG.PRG WITH "-t","template.dbf.cfg" ==> Generates a template for table.dbf.cfg per table config file with newest settings
|
||||
```
|
||||
|
||||
See [command line](./FoxBin2Prg_Run.md#usage-2).
|
||||
The options in the template (or in the config that ships with FoxBin2Prg) are commented out.
|
||||
To activate an option remove the asterix and set appropriate value.
|
||||
These are the Table.dbf.cfg configuration file settings and their meaning:
|
||||
|
||||
| FoxBin2Prg.cfg keywords | Value | Description |
|
||||
| ----- | ----- | ----- |
|
||||
| DBF_Conversion_Support | 0, 1, 2, 4, 8 | 0=No support,<br/>1=Generate Header _Text_ only (Diff),<br/>2=Generate Header _Text_ and _Bin_ (Merge/Only Structure!),<br/>4=Generate _Text_ with DATA (Diff),<br/>8=Export and Import DATA (Merge/Structure & Data) |
|
||||
| DBF_Conversion_Order | c_Expression | Field expresion (For _INDEX ON_). ie: name+str(age,3),<br/>Empty means no sort order. <br/> usefull only if _DBF_Conversion_Support_>0 |
|
||||
| DBF_Conversion_Condition | c_Expression | Logical expression (For _SCAN FOR_). ie: age > 10 AND NOT DELETED(),<br/>empty means all files, except _DBF_IncludeDeleted_ <br/> usefull only if _DBF_Conversion_Support_>0 |
|
||||
| DBF_BinChar_Base64 | 0, 1 | 0=For character type fields, if NoCPTrans 0=do not transform,<br/>1=use Base64 transform <br/> usefull only if _DBF_Conversion_Support_>2 |
|
||||
| DBF_IncludeDeleted | 0, 1 | 0=Do not include deleted records,<br/>1=Include deleted records <br/> usefull only if _DBF_Conversion_Support_>2 |
|
||||
|
||||
For defaults, see [Configuration file](#configuration-file).
|
||||
|
||||
## FoxBin2Prg Internals
|
||||
### ZOrder
|
||||
In _Text_ 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.
|
||||
_Text_ files keep lists of objects and their 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_controls AS container && "cnt_controls" class description
|
||||
*< 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 their ZOrder, and this does auto-renumbering when generating _Binaries_.
|
||||
|
||||
### RemoveZOrderSetFromProps setting
|
||||
#### Note:
|
||||
The ZOrderSet property is not shown in VFP Properties editor.
|
||||
|
||||
Starting at v1.19.43 there is a new configuration setting named RemoveZOrderSetFromProps,
|
||||
that can be used to automatically remove this property from the objects, if enabled with 1.
|
||||
This property keep the order of the inherited controls used on visual classes using a numeric value like the Tabstop property,
|
||||
but this property is not shown to the user and sometimes their value is duplicated, causing that every time you save a visual class
|
||||
or form, some control(s) get their order swapped, so when reopening the visual class some objects that should appear on top
|
||||
are on botton and vice versa.
|
||||
|
||||
#### VFP ZOrder bug and fix
|
||||
Sometimes you can see that some objects are reordered every time you save a visual form/class
|
||||
and generate the _Text_ file. This is caused because in some situations VFP can loose the tracking to some ZOrders,
|
||||
and duplicate them. To **fix** this problem, you just need to open your visual form/class,
|
||||
reorder manually the offending objects to force VFP to assign a new ZOrder value and generate the _Text_ file.
|
||||
You can see (only in the _Text_ file or inside the vcx/vct) that the property is called ZOrderSet and have a repeated value
|
||||
before fixing it. Another solution, starting at v1.19.43, is using RemoveZOrderSetFromProps:1 in foxbin2prg.cfg file to
|
||||
remove this from the properties. A better solution is using this setting only in a specific directory used to fix this
|
||||
kind of problems. In any case, for this setting to work properly, you need to generate the _Binary_
|
||||
|
||||
### DBC ordered fields
|
||||
Starting from v1.19.42 the members of the DBC are ordered alphabetically, including fields of DBFs and Views, Connections, Tables,
|
||||
Views and Relations. All this to minimize the differences when diffing DBCs that have constant changes.
|
||||
````
|
||||
<FIELD_ORDER>
|
||||
depto
|
||||
descrip
|
||||
</FIELD_ORDER>
|
||||
````
|
||||
### PAM Section
|
||||
This section is generated for classes and forms, it is delimited with the <DefinedPropArrayMethod> tag,
|
||||
and have the definition of Properties, Arrays and Methods, with their comments, like this example:
|
||||
````
|
||||
DEFINE CLASS c1 AS custom OLEPUBLIC && Description of "c1" class
|
||||
*<DefinedPropArrayMethod>
|
||||
*m: emptymethod_with_comments && This method have no code, just comments!
|
||||
*m: mymethod && My Method
|
||||
*p: prop1 && My prop 1
|
||||
*p: special_prop_with_cr
|
||||
*p: special_prop_with_crlf && Should have CR+LF
|
||||
*a: array_1_d[1,0](1,0) && 1 dimension array (1)
|
||||
*a: array_2_d[1,2](1,2) && 2 dimension array (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,
|
||||
which makes this section more easy to maintain.
|
||||
|
||||
### Property Ordering
|
||||
On _Text_ files is easy, ordering for methods and properties is done in alphabetical way, like scctext does with methods.
|
||||
This makes comparisons easier and with less differences.
|
||||
On _Binaries_, property ordering is a very different thing. No documentation is available about this,
|
||||
so the only guideline is trying to make it as FoxPro does, but this is not always possible because there are two extreme cases,
|
||||
and variants between the them:
|
||||
1. The best and easy one, is when defining a class (or control) with his properties: In this case,
|
||||
each class have a phisical record on the scx/vcx table, and all the properties of it are keep toghether,
|
||||
so this ordering can be easily duplicated (look at "TESTS\DATOS_READONLY\f_form_aa.scx file" on foxbin2prg project
|
||||
and open it as a table to see the class per record)
|
||||
2. The worst and most difficult case, is when there is a container with controls subclassed,
|
||||
and properties are changed on the instance: In this case FoxPro makes a big and unique list of properties of all objects
|
||||
in just one phisical record, so there is no way to know which property corresponds to which class. For this case,
|
||||
I've made a unique list composed of all properties of all classes,
|
||||
ordered according to most common orderings (look at "TESTS\DATOS_READONLY\f_form_aa2.scx file" on foxbin2prg project
|
||||
and open it as a table to see all the properties of all the classes of the same earlier example, in just one record)
|
||||
|
||||
For these two cases, and starting from v1.19.22, I've created several "props_*" files with ordering by class for the 1st case,
|
||||
and a list with all in it ("props_all.txt") for the second case, so in case of any problems,
|
||||
rearranging some props will be an easy thing.
|
||||
|
||||
#### Warning
|
||||
These "props_**" files are necessary in the foxbin2prg install directory.
|
||||
|
||||
It's recommended to use the EXE version that have all files included and is faster._
|
||||
Several Unit Tests (in TESTS directory) are made to make the best effort to cover the most typical use cases.
|
||||
There is also an Excel spreedsheet with the compilation of properties of each class with the order that FoxPro uses internally,
|
||||
and a tab with the all-in-one order for the worst case.
|
||||
|
||||
### Timestamps and UniqueIDs
|
||||
Timestamp field are used in VFP to track changes with 3rd party tools and UniqueId is used to identify classes inside _Binaries_,
|
||||
but, AFAIK, they are not used by VFP itself. There are 2 switches, enabled by default,
|
||||
that are used to clear this values (ClearUniqueId and NoTimestamps),
|
||||
so no differences are shown for this values constantly changing.
|
||||
Starting from v1.19.23 this values are just cleared on _Text_ files, and generated on the _Binaries_,
|
||||
as well the sccdata field, because this way there are no differences when opening/closing certain files, as a PJX,
|
||||
which by default fill some of this fields even if no modifications are made, which causes that SCM tools detect those changes.
|
||||
Having them prefilled, then no changes are detected.
|
||||
|
||||
### DBF Data Export/Import for Diff/Merge
|
||||
Starting at version v1.19.21, and thanks to Doug Hennig proposal and coding, FoxBin2Prg can export DBFs Data,
|
||||
specially intended for small DBFs, as config ones, on which sometimes is needed to track the changes.
|
||||
It is deactivated by default, but can be activated with **"DBF_Conversion_Support: 4"** in foxbin2prg.cfg
|
||||
Since version v1.19.47, importing of Data can be activated with **"DBF_Conversion_Support: 8"** in foxbin2prg.cfg
|
||||
If you want to export the data of just some tables and not for all of them, one way is moving the tables
|
||||
for data export to another directory, or even a subdirectory of main data files,
|
||||
and write a foxbin2prg.cfg with **"DBF_Conversion_Support: 4 or 8"** for this diretory only,
|
||||
taking advantage of multi-configuration capability introduced on v1.19.25
|
||||
A much better option that join the best of the two worlds, available from v1.19.44,
|
||||
could be using the default setting **"DBF_Conversion_Support: 1"** and using **individual cfg files** for each table
|
||||
(table.dbf.cfg) on which you want to export their data, so this way you can have only the structure in DB2 files
|
||||
and some tables with their data exported for easy diffing with previous versions,
|
||||
or even use **"DBF_Conversion_Support: 8"** (available since v1.19.47) for bidirectional support of data import/export.
|
||||
|
||||
### Order and range of records
|
||||
**FoxBin2prg.cfg (Main CFG, Directory CFG or Table CFG)**
|
||||
New foxbin2prg.cfg options for filtering tables from conversion using one or multiple conbinations of filemasks.
|
||||
|
||||
#### Syntax
|
||||
````
|
||||
"DBF_Conversion_Included: <filemask>[ ,<filemask> [ , ... ](-,_filemask_-[-,-...-) ]"
|
||||
"DBF_Conversion_Excluded: <filemask>[ ,<filemask> [ , ... ](-,_filemask_-[-,-...-) ]"
|
||||
````
|
||||
|
||||
Example of multiple file masks (separte with ","):
|
||||
````
|
||||
"DBF_Conversion_Included: PET**.**, ??ME.DBF, ???.DBF, ?.**"
|
||||
````
|
||||
|
||||
### Configuration per table
|
||||
New <filename.dbf.cfg> configuration options. See [Configuration file per table](#configuration-file-per-table).
|
||||
|
||||
These options can be used in any combination inside a dbf particular cfg file,
|
||||
if you create a text file using your dbf filename and adding ".cfg".
|
||||
|
||||
#### Syntax for filename.dbf.cfg contents
|
||||
````
|
||||
"DBF_Conversion_Support: <4 for export only or 8 for bidirectional support>"
|
||||
"DBF_Conversion_Order: <C_Expression>"
|
||||
"DBF_Conversion_Condition: <C_Expression>"
|
||||
````
|
||||
|
||||
#### Example: customers.dbf.cfg
|
||||
````
|
||||
"DBF_Conversion_Support: 4"
|
||||
"DBF_Conversion_Order: cust_no"
|
||||
"DBF_Conversion_Condition: cust_no > 10"
|
||||
````
|
||||
|
||||
### DBF/DB2 Convertion Hooks
|
||||
From version v1.19.19 there is a new property "run_AfterCreateTable" and from version v1.19.24 "run_AfterCreate_DB2".
|
||||
The purpose of both properties is to allow the execution of an external program each time a DBF is converted to DB2 or a DB2
|
||||
is converted to DBF.
|
||||
The main purpose of FoxBin2Prg is to be used for Diff and Merge with a SCM tool, so in this scenario the data is not needed,
|
||||
but there are use cases where exporting, importing or manipulating data is needed while making the conversions, and for those cases are this properties.
|
||||
|
||||
#### This is a sample program
|
||||
````
|
||||
*-- DEMO HOOK FOR PROCESSING DBFs AND DB2
|
||||
LOCAL oFB AS 'c_foxbin2prg' OF 'c:\desa\foxbin2prg\foxbin2prg.prg'
|
||||
oFB = NEWOBJECT( 'c_foxbin2prg', 'c:\desa\foxbin2prg\foxbin2prg.prg' )
|
||||
oFB.DBF_Conversion_Support = 2
|
||||
oFB.run_AfterCreateTable = 'p_AfterCreateTable'
|
||||
oFB.run_AfterCreate_DB2 = 'p_AfterCreate_DB2'
|
||||
oFB.execute( 'C:\DESA\foxbin2prg\TESTS\DATOS_TEST\fb2p_dbc.dc2' )
|
||||
oFB.execute( 'C:\DESA\foxbin2prg\TESTS\DATOS_TEST\fb2p_dbf.db2' )
|
||||
oFB.execute( 'C:\DESA\foxbin2prg\TESTS\DATOS_TEST\fb2p_dbf.dbf' )
|
||||
oFB = NULL
|
||||
RETURN
|
||||
|
||||
|
||||
PROCEDURE p_AfterCreateTable
|
||||
LPARAMETERS lnDataSessionID, tc_OutputFile, toTable
|
||||
MESSAGEBOX( 'Actual Datasession: ' + TRANSFORM(SET("Datasession")) + CHR(13) ;
|
||||
+ 'lnDataSessionID: ' + TRANSFORM(lnDataSessionID) )
|
||||
*-- You can fill the table <tc_OutputFile> here.
|
||||
INSERT INTO fb2p_dbf (nombre,edad,depto) VALUES ('Fer', 45, 'dpto')
|
||||
ENDPROC
|
||||
|
||||
|
||||
PROCEDURE p_AfterCreate_DB2
|
||||
LPARAMETERS lnDataSessionID, tc_OutputFile, toTable
|
||||
MESSAGEBOX( 'Actual Datasession: ' + TRANSFORM(SET("Datasession")) + CHR(13) ;
|
||||
+ 'lnDataSessionID: ' + TRANSFORM(lnDataSessionID) )
|
||||
*-- You can export the data here.
|
||||
STRTOFILE( nombre + STR(edad,3) + depto, 'c:\temp\data.txt', 1)
|
||||
ENDPROC
|
||||
````
|
||||
### Language Support for messages
|
||||
As for version v1.19.38 FoxBin2Prg messages are available natively on Spanish, English, German and French.
|
||||
|
||||
#### Note
|
||||
The messages on vbs scripts are not translated (are very few), just the FoxPro ones,
|
||||
which have +90% of the messages.
|
||||
|
||||
**Want to collaborate translating the messages to your language so others can use it?**
|
||||
Just copy the english translation CASE in the final section in FoxBin2Prg.PRG to a new CASE
|
||||
with your country code and translate the messages (can be done in 20 minutes or less),
|
||||
and send it to me. I will include it in the next release ;-)
|
||||
|
||||
#### Note
|
||||
.h language files are not supported anymore, and are now implemented inside foxbin2prg,
|
||||
in the "C_LANG" class at the end of the PRG_
|
||||
|
||||
### Multi-config
|
||||
Starting at version v1.19.25 FoxBin2Prg allow configuration per directory,
|
||||
overriding the main configuration of FoxBin2Prg directory.
|
||||
The override is by each setting, so you can reconfigure one or more settings and the
|
||||
remaining settings are inherited from main CFG.
|
||||
|
||||
From v1.19.42 CFGs are inherited between directories from parent to child,
|
||||
so if you have all your developments under, let's say, "c:\devs" directory and subdirs,
|
||||
de CFG in "c:\devs" will be inherited on subdirs, and settings can be overriden one by one if you want to.
|
||||
This inheritance saves a lot of time and minimizes the CFGs needed \:\)
|
||||
|
||||
##### Note
|
||||
Options will be read outside in, top to down.
|
||||
If an option is defined multiple times, even in the same file, last occurance wins.
|
||||
This exception is the group controlling the new style to split DBC files.
|
||||
The options _UseFilesPerDBC_, _RedirectFilePerDBCToMain_ and _ItemPerDBCCheck_ will be ignored,
|
||||
if _OldFilesPerDBC_ is set to 0.
|
||||
If _OldFilesPerDBC_ is set to 0 after it was active, the values of the three options are rejected at all.
|
||||
|
||||
### File Capitalization
|
||||
FoxBin2Prg takes care of file capitalization (their extension, specifically),
|
||||
using another program called ("filename_caps.exe") for capitalizing input files and output files.
|
||||
This is because some SCM and DVCS tools are multiplatform, and if you add a "file.ext"
|
||||
and later add a "file.EXT" or "File.Ext", the SCM can interpret them as different files,
|
||||
because on Unix, Linux, Mac and other sistems, they are.
|
||||
If you want a special capitalization (ie: capitalize the full name of the file),
|
||||
you can configure this behaviour in "filename_caps.cfg" configuration file, which includes syntax examples.
|
||||
File capitalization occurs when you convert a file, but in the case that the input file can't be converted,
|
||||
no message error ir thrown (ie: when using the PRG version from VFP Command Line with the form to be converted opened)
|
||||
|
||||
### Conversion processes Logging
|
||||
If you want detailed process logging of FoxBin2Prg conversions,
|
||||
to see all internal processes, decisions and used optimizations, you can enable debugging using
|
||||
+debug:1+ in foxbin2prg.cfg configuration file, and a full log is generated on FoxBin2Prg installation directory.
|
||||
Debug messages are translated (+90% of debug messages), but capitalization process messages are not,
|
||||
and are available just in Spanish (-10% of debug messages).
|
||||
|
||||
### Create Class-Per-File
|
||||
Starting at v1.19.37 you can configure foxbin2prg to generate one class per file using TwoFox naming style "basefile.class.vc2"
|
||||
with the value "1"
|
||||
To configure this, you must first enable it in foxbin2prg.cfg file:
|
||||
````
|
||||
*UseClassPerFile: 1 && 0=One library _Text_ file, 1=Multiple file.class.vc2 files, 2=Multiple file.baseclass.class.vc2 files
|
||||
````
|
||||
In example, if you have a classlib "mylib.vcx" with 3 classes inside ( "cl_1, cl_2, cl_3") then this files are generated:
|
||||
|
||||
- mylib.vc2 => Header file, with all conforming classes annotated inside
|
||||
- mylib.cl_1.vc2
|
||||
- mylib.cl_2.vc2
|
||||
- mylib.cl_3.vc2
|
||||
#### Important note
|
||||
The settings of UseClassPerFile and related options are sensible. If changed the wrong way it easy to destroy classlibs.
|
||||
| Language | _(auto)_, EN, FR, ES, DE | Language of templates, shown messages and LOGs. EN=English, FR=French, ES=Español, DE=German, Not defined = AUTOMATIC (using VERSION(3)) ||
|
||||
| HomeDir | 0, _1_ | 0=don't save HomeDir in PJ2,<br/>1=save HomeDir in PJ2.<br/>Setting this to 0 prevents the PJ2 file from changing just because two developers have the project in different folders |
|
||||
|
||||
### Note
|
||||
The options will be read outside in, top to down. See [Multi-config](#multi-config)
|
||||
|
||||
## Configuration file per table
|
||||
Those configuration files are valid for a single table only. The idea is to have special settings for single tables.
|
||||
It is possible to create a template with all options and comments via
|
||||
```
|
||||
DO FOXBIN2PRG.PRG WITH "-t","template.dbf.cfg" ==> Generates a template for table.dbf.cfg per table config file with newest settings
|
||||
```
|
||||
|
||||
See [command line](./FoxBin2Prg_Run.md#usage-2).
|
||||
The options in the template (or in the config that ships with FoxBin2Prg) are commented out.
|
||||
To activate an option remove the asterix and set appropriate value.
|
||||
These are the Table.dbf.cfg configuration file settings and their meaning:
|
||||
|
||||
| FoxBin2Prg.cfg keywords | Value | Description |
|
||||
| ----- | ----- | ----- |
|
||||
| DBF_Conversion_Support | 0, 1, 2, 4, 8 | 0=No support,<br/>1=Generate Header _Text_ only (Diff),<br/>2=Generate Header _Text_ and _Bin_ (Merge/Only Structure!),<br/>4=Generate _Text_ with DATA (Diff),<br/>8=Export and Import DATA (Merge/Structure & Data) |
|
||||
| DBF_Conversion_Order | c_Expression | Field expresion (For _INDEX ON_). ie: name+str(age,3),<br/>Empty means no sort order. <br/> usefull only if _DBF_Conversion_Support_>0 |
|
||||
| DBF_Conversion_Condition | c_Expression | Logical expression (For _SCAN FOR_). ie: age > 10 AND NOT DELETED(),<br/>empty means all files, except _DBF_IncludeDeleted_ <br/> usefull only if _DBF_Conversion_Support_>0 |
|
||||
| DBF_BinChar_Base64 | 0, 1 | 0=For character type fields, if NoCPTrans 0=do not transform,<br/>1=use Base64 transform <br/> usefull only if _DBF_Conversion_Support_>2 |
|
||||
| DBF_IncludeDeleted | 0, 1 | 0=Do not include deleted records,<br/>1=Include deleted records <br/> usefull only if _DBF_Conversion_Support_>2 |
|
||||
|
||||
For defaults, see [Configuration file](#configuration-file).
|
||||
|
||||
## FoxBin2Prg Internals
|
||||
### ZOrder
|
||||
In _Text_ 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.
|
||||
_Text_ files keep lists of objects and their 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_controls AS container && "cnt_controls" class description
|
||||
*< 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 their ZOrder, and this does auto-renumbering when generating _Binaries_.
|
||||
|
||||
### RemoveZOrderSetFromProps setting
|
||||
#### Note:
|
||||
The ZOrderSet property is not shown in VFP Properties editor.
|
||||
|
||||
Starting at v1.19.43 there is a new configuration setting named RemoveZOrderSetFromProps,
|
||||
that can be used to automatically remove this property from the objects, if enabled with 1.
|
||||
This property keep the order of the inherited controls used on visual classes using a numeric value like the Tabstop property,
|
||||
but this property is not shown to the user and sometimes their value is duplicated, causing that every time you save a visual class
|
||||
or form, some control(s) get their order swapped, so when reopening the visual class some objects that should appear on top
|
||||
are on botton and vice versa.
|
||||
|
||||
#### VFP ZOrder bug and fix
|
||||
Sometimes you can see that some objects are reordered every time you save a visual form/class
|
||||
and generate the _Text_ file. This is caused because in some situations VFP can loose the tracking to some ZOrders,
|
||||
and duplicate them. To **fix** this problem, you just need to open your visual form/class,
|
||||
reorder manually the offending objects to force VFP to assign a new ZOrder value and generate the _Text_ file.
|
||||
You can see (only in the _Text_ file or inside the vcx/vct) that the property is called ZOrderSet and have a repeated value
|
||||
before fixing it. Another solution, starting at v1.19.43, is using RemoveZOrderSetFromProps:1 in foxbin2prg.cfg file to
|
||||
remove this from the properties. A better solution is using this setting only in a specific directory used to fix this
|
||||
kind of problems. In any case, for this setting to work properly, you need to generate the _Binary_
|
||||
|
||||
### DBC ordered fields
|
||||
Starting from v1.19.42 the members of the DBC are ordered alphabetically, including fields of DBFs and Views, Connections, Tables,
|
||||
Views and Relations. All this to minimize the differences when diffing DBCs that have constant changes.
|
||||
````
|
||||
<FIELD_ORDER>
|
||||
depto
|
||||
descrip
|
||||
</FIELD_ORDER>
|
||||
````
|
||||
### PAM Section
|
||||
This section is generated for classes and forms, it is delimited with the <DefinedPropArrayMethod> tag,
|
||||
and have the definition of Properties, Arrays and Methods, with their comments, like this example:
|
||||
````
|
||||
DEFINE CLASS c1 AS custom OLEPUBLIC && Description of "c1" class
|
||||
*<DefinedPropArrayMethod>
|
||||
*m: emptymethod_with_comments && This method have no code, just comments!
|
||||
*m: mymethod && My Method
|
||||
*p: prop1 && My prop 1
|
||||
*p: special_prop_with_cr
|
||||
*p: special_prop_with_crlf && Should have CR+LF
|
||||
*a: array_1_d[1,0](1,0) && 1 dimension array (1)
|
||||
*a: array_2_d[1,2](1,2) && 2 dimension array (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,
|
||||
which makes this section more easy to maintain.
|
||||
|
||||
### Property Ordering
|
||||
On _Text_ files is easy, ordering for methods and properties is done in alphabetical way, like scctext does with methods.
|
||||
This makes comparisons easier and with less differences.
|
||||
On _Binaries_, property ordering is a very different thing. No documentation is available about this,
|
||||
so the only guideline is trying to make it as FoxPro does, but this is not always possible because there are two extreme cases,
|
||||
and variants between the them:
|
||||
1. The best and easy one, is when defining a class (or control) with his properties: In this case,
|
||||
each class have a phisical record on the scx/vcx table, and all the properties of it are keep toghether,
|
||||
so this ordering can be easily duplicated (look at "TESTS\DATOS_READONLY\f_form_aa.scx file" on foxbin2prg project
|
||||
and open it as a table to see the class per record)
|
||||
2. The worst and most difficult case, is when there is a container with controls subclassed,
|
||||
and properties are changed on the instance: In this case FoxPro makes a big and unique list of properties of all objects
|
||||
in just one phisical record, so there is no way to know which property corresponds to which class. For this case,
|
||||
I've made a unique list composed of all properties of all classes,
|
||||
ordered according to most common orderings (look at "TESTS\DATOS_READONLY\f_form_aa2.scx file" on foxbin2prg project
|
||||
and open it as a table to see all the properties of all the classes of the same earlier example, in just one record)
|
||||
|
||||
For these two cases, and starting from v1.19.22, I've created several "props_*" files with ordering by class for the 1st case,
|
||||
and a list with all in it ("props_all.txt") for the second case, so in case of any problems,
|
||||
rearranging some props will be an easy thing.
|
||||
|
||||
#### Warning
|
||||
These "props_**" files are necessary in the foxbin2prg install directory.
|
||||
|
||||
It's recommended to use the EXE version that have all files included and is faster._
|
||||
Several Unit Tests (in TESTS directory) are made to make the best effort to cover the most typical use cases.
|
||||
There is also an Excel spreedsheet with the compilation of properties of each class with the order that FoxPro uses internally,
|
||||
and a tab with the all-in-one order for the worst case.
|
||||
|
||||
### Timestamps and UniqueIDs
|
||||
Timestamp field are used in VFP to track changes with 3rd party tools and UniqueId is used to identify classes inside _Binaries_,
|
||||
but, AFAIK, they are not used by VFP itself. There are 2 switches, enabled by default,
|
||||
that are used to clear this values (ClearUniqueId and NoTimestamps),
|
||||
so no differences are shown for this values constantly changing.
|
||||
Starting from v1.19.23 this values are just cleared on _Text_ files, and generated on the _Binaries_,
|
||||
as well the sccdata field, because this way there are no differences when opening/closing certain files, as a PJX,
|
||||
which by default fill some of this fields even if no modifications are made, which causes that SCM tools detect those changes.
|
||||
Having them prefilled, then no changes are detected.
|
||||
|
||||
### DBF Data Export/Import for Diff/Merge
|
||||
Starting at version v1.19.21, and thanks to Doug Hennig proposal and coding, FoxBin2Prg can export DBFs Data,
|
||||
specially intended for small DBFs, as config ones, on which sometimes is needed to track the changes.
|
||||
It is deactivated by default, but can be activated with **"DBF_Conversion_Support: 4"** in foxbin2prg.cfg
|
||||
Since version v1.19.47, importing of Data can be activated with **"DBF_Conversion_Support: 8"** in foxbin2prg.cfg
|
||||
If you want to export the data of just some tables and not for all of them, one way is moving the tables
|
||||
for data export to another directory, or even a subdirectory of main data files,
|
||||
and write a foxbin2prg.cfg with **"DBF_Conversion_Support: 4 or 8"** for this diretory only,
|
||||
taking advantage of multi-configuration capability introduced on v1.19.25
|
||||
A much better option that join the best of the two worlds, available from v1.19.44,
|
||||
could be using the default setting **"DBF_Conversion_Support: 1"** and using **individual cfg files** for each table
|
||||
(table.dbf.cfg) on which you want to export their data, so this way you can have only the structure in DB2 files
|
||||
and some tables with their data exported for easy diffing with previous versions,
|
||||
or even use **"DBF_Conversion_Support: 8"** (available since v1.19.47) for bidirectional support of data import/export.
|
||||
|
||||
### Order and range of records
|
||||
**FoxBin2prg.cfg (Main CFG, Directory CFG or Table CFG)**
|
||||
New foxbin2prg.cfg options for filtering tables from conversion using one or multiple conbinations of filemasks.
|
||||
|
||||
#### Syntax
|
||||
````
|
||||
"DBF_Conversion_Included: <filemask>[ ,<filemask> [ , ... ](-,_filemask_-[-,-...-) ]"
|
||||
"DBF_Conversion_Excluded: <filemask>[ ,<filemask> [ , ... ](-,_filemask_-[-,-...-) ]"
|
||||
````
|
||||
|
||||
Example of multiple file masks (separte with ","):
|
||||
````
|
||||
"DBF_Conversion_Included: PET**.**, ??ME.DBF, ???.DBF, ?.**"
|
||||
````
|
||||
|
||||
### Configuration per table
|
||||
New <filename.dbf.cfg> configuration options. See [Configuration file per table](#configuration-file-per-table).
|
||||
|
||||
These options can be used in any combination inside a dbf particular cfg file,
|
||||
if you create a text file using your dbf filename and adding ".cfg".
|
||||
|
||||
#### Syntax for filename.dbf.cfg contents
|
||||
````
|
||||
"DBF_Conversion_Support: <4 for export only or 8 for bidirectional support>"
|
||||
"DBF_Conversion_Order: <C_Expression>"
|
||||
"DBF_Conversion_Condition: <C_Expression>"
|
||||
````
|
||||
|
||||
#### Example: customers.dbf.cfg
|
||||
````
|
||||
"DBF_Conversion_Support: 4"
|
||||
"DBF_Conversion_Order: cust_no"
|
||||
"DBF_Conversion_Condition: cust_no > 10"
|
||||
````
|
||||
|
||||
### DBF/DB2 Convertion Hooks
|
||||
From version v1.19.19 there is a new property "run_AfterCreateTable" and from version v1.19.24 "run_AfterCreate_DB2".
|
||||
The purpose of both properties is to allow the execution of an external program each time a DBF is converted to DB2 or a DB2
|
||||
is converted to DBF.
|
||||
The main purpose of FoxBin2Prg is to be used for Diff and Merge with a SCM tool, so in this scenario the data is not needed,
|
||||
but there are use cases where exporting, importing or manipulating data is needed while making the conversions, and for those cases are this properties.
|
||||
|
||||
#### This is a sample program
|
||||
````
|
||||
*-- DEMO HOOK FOR PROCESSING DBFs AND DB2
|
||||
LOCAL oFB AS 'c_foxbin2prg' OF 'c:\desa\foxbin2prg\foxbin2prg.prg'
|
||||
oFB = NEWOBJECT( 'c_foxbin2prg', 'c:\desa\foxbin2prg\foxbin2prg.prg' )
|
||||
oFB.DBF_Conversion_Support = 2
|
||||
oFB.run_AfterCreateTable = 'p_AfterCreateTable'
|
||||
oFB.run_AfterCreate_DB2 = 'p_AfterCreate_DB2'
|
||||
oFB.execute( 'C:\DESA\foxbin2prg\TESTS\DATOS_TEST\fb2p_dbc.dc2' )
|
||||
oFB.execute( 'C:\DESA\foxbin2prg\TESTS\DATOS_TEST\fb2p_dbf.db2' )
|
||||
oFB.execute( 'C:\DESA\foxbin2prg\TESTS\DATOS_TEST\fb2p_dbf.dbf' )
|
||||
oFB = NULL
|
||||
RETURN
|
||||
|
||||
|
||||
PROCEDURE p_AfterCreateTable
|
||||
LPARAMETERS lnDataSessionID, tc_OutputFile, toTable
|
||||
MESSAGEBOX( 'Actual Datasession: ' + TRANSFORM(SET("Datasession")) + CHR(13) ;
|
||||
+ 'lnDataSessionID: ' + TRANSFORM(lnDataSessionID) )
|
||||
*-- You can fill the table <tc_OutputFile> here.
|
||||
INSERT INTO fb2p_dbf (nombre,edad,depto) VALUES ('Fer', 45, 'dpto')
|
||||
ENDPROC
|
||||
|
||||
|
||||
PROCEDURE p_AfterCreate_DB2
|
||||
LPARAMETERS lnDataSessionID, tc_OutputFile, toTable
|
||||
MESSAGEBOX( 'Actual Datasession: ' + TRANSFORM(SET("Datasession")) + CHR(13) ;
|
||||
+ 'lnDataSessionID: ' + TRANSFORM(lnDataSessionID) )
|
||||
*-- You can export the data here.
|
||||
STRTOFILE( nombre + STR(edad,3) + depto, 'c:\temp\data.txt', 1)
|
||||
ENDPROC
|
||||
````
|
||||
### Language Support for messages
|
||||
As for version v1.19.38 FoxBin2Prg messages are available natively on Spanish, English, German and French.
|
||||
|
||||
#### Note
|
||||
The messages on vbs scripts are not translated (are very few), just the FoxPro ones,
|
||||
which have +90% of the messages.
|
||||
|
||||
**Want to collaborate translating the messages to your language so others can use it?**
|
||||
Just copy the english translation CASE in the final section in FoxBin2Prg.PRG to a new CASE
|
||||
with your country code and translate the messages (can be done in 20 minutes or less),
|
||||
and send it to me. I will include it in the next release ;-)
|
||||
|
||||
#### Note
|
||||
.h language files are not supported anymore, and are now implemented inside foxbin2prg,
|
||||
in the "C_LANG" class at the end of the PRG_
|
||||
|
||||
### Multi-config
|
||||
Starting at version v1.19.25 FoxBin2Prg allow configuration per directory,
|
||||
overriding the main configuration of FoxBin2Prg directory.
|
||||
The override is by each setting, so you can reconfigure one or more settings and the
|
||||
remaining settings are inherited from main CFG.
|
||||
|
||||
From v1.19.42 CFGs are inherited between directories from parent to child,
|
||||
so if you have all your developments under, let's say, "c:\devs" directory and subdirs,
|
||||
de CFG in "c:\devs" will be inherited on subdirs, and settings can be overriden one by one if you want to.
|
||||
This inheritance saves a lot of time and minimizes the CFGs needed \:\)
|
||||
|
||||
##### Note
|
||||
Options will be read outside in, top to down.
|
||||
If an option is defined multiple times, even in the same file, last occurance wins.
|
||||
This exception is the group controlling the new style to split DBC files.
|
||||
The options _UseFilesPerDBC_, _RedirectFilePerDBCToMain_ and _ItemPerDBCCheck_ will be ignored,
|
||||
if _OldFilesPerDBC_ is set to 0.
|
||||
If _OldFilesPerDBC_ is set to 0 after it was active, the values of the three options are rejected at all.
|
||||
|
||||
### File Capitalization
|
||||
FoxBin2Prg takes care of file capitalization (their extension, specifically),
|
||||
using another program called ("filename_caps.exe") for capitalizing input files and output files.
|
||||
This is because some SCM and DVCS tools are multiplatform, and if you add a "file.ext"
|
||||
and later add a "file.EXT" or "File.Ext", the SCM can interpret them as different files,
|
||||
because on Unix, Linux, Mac and other sistems, they are.
|
||||
If you want a special capitalization (ie: capitalize the full name of the file),
|
||||
you can configure this behaviour in "filename_caps.cfg" configuration file, which includes syntax examples.
|
||||
File capitalization occurs when you convert a file, but in the case that the input file can't be converted,
|
||||
no message error ir thrown (ie: when using the PRG version from VFP Command Line with the form to be converted opened)
|
||||
|
||||
### Conversion processes Logging
|
||||
If you want detailed process logging of FoxBin2Prg conversions,
|
||||
to see all internal processes, decisions and used optimizations, you can enable debugging using
|
||||
+debug:1+ in foxbin2prg.cfg configuration file, and a full log is generated on FoxBin2Prg installation directory.
|
||||
Debug messages are translated (+90% of debug messages), but capitalization process messages are not,
|
||||
and are available just in Spanish (-10% of debug messages).
|
||||
|
||||
### Create Class-Per-File
|
||||
Starting at v1.19.37 you can configure foxbin2prg to generate one class per file using TwoFox naming style "basefile.class.vc2"
|
||||
with the value "1"
|
||||
To configure this, you must first enable it in foxbin2prg.cfg file:
|
||||
````
|
||||
*UseClassPerFile: 1 && 0=One library _Text_ file, 1=Multiple file.class.vc2 files, 2=Multiple file.baseclass.class.vc2 files
|
||||
````
|
||||
In example, if you have a classlib "mylib.vcx" with 3 classes inside ( "cl_1, cl_2, cl_3") then this files are generated:
|
||||
|
||||
- mylib.vc2 => Header file, with all conforming classes annotated inside
|
||||
- mylib.cl_1.vc2
|
||||
- mylib.cl_2.vc2
|
||||
- mylib.cl_3.vc2
|
||||
#### Important note
|
||||
The settings of UseClassPerFile and related options are sensible. If changed the wrong way it easy to destroy classlibs.
|
||||
|
||||
#### Recommended new setting
|
||||
Starting at v1.19.42 you can configure foxbin2prg to generate one class per file.
|
||||
@@ -443,17 +443,17 @@ mylib.textbox.cl_3.vc2
|
||||
|
||||
#### Complementary options for the UseClassPerFile setting
|
||||
##### RedirectClassPerFileToMain:
|
||||
Configuring this setting to 1 will redirect any selection of file[.baseclass].class.vc2
|
||||
Configuring this setting to 1 will redirect any selection of file[.baseclass].class.vc2
|
||||
to the main file.vc2 file, which will not let you generate individual vcx files by mistake.
|
||||
RedirectClassType: 1 precedes this setting for files in the
|
||||
|
||||
RedirectClassType: 1 precedes this setting for files in the
|
||||
|
||||
|
||||
##### ClassPerFileCheck
|
||||
Configuring this setting to 1 will check the inclusion of all file[.baseclass].class.vc2 files
|
||||
Configuring this setting to 1 will check the inclusion of all file[.baseclass].class.vc2 files
|
||||
annotated on file.vc2 main file, otherwise no checking is made and when reconstructing the vcx/scx all files
|
||||
containing the file.class.ext naming will be included in the _Binary_ (useful when you want to add external classes to the library).
|
||||
This only used if import file is in file[.baseclass].class.tx2 syntax.
|
||||
Ignored for RedirectClassType: 2
|
||||
containing the file.class.ext naming will be included in the _Binary_ (useful when you want to add external classes to the library).
|
||||
This only used if import file is in file[.baseclass].class.tx2 syntax.
|
||||
Ignored for RedirectClassType: 2
|
||||
|
||||
#### Note
|
||||
If you dont use the redirect setting, an individual vcx/scx file will be generated.
|
||||
|
||||
Binary file not shown.
@@ -12,7 +12,6 @@
|
||||
*BackgroundImage: <cFile> && Backgroundimage for process form. Empty for empty Background. File not found uses default.
|
||||
*HomeDir: 1 && 0 = don't save HomeDir in PJ2, [1 = save HomeDir in PJ2]
|
||||
*----------------------------------------------------------------------------------------------------------------
|
||||
*HomeDir: 1 && 0 = don't save HomeDir in PJ2, [1 = save HomeDir in PJ2]
|
||||
|
||||
*-- Conversion operation by type
|
||||
*PJX_Conversion_Support: 2 && 0=No support, 1=Generate TXT only (Diff), 2=Generate TXT and BIN (Merge)
|
||||
@@ -82,7 +81,6 @@
|
||||
|
||||
*-- Text file extensions
|
||||
*extension: tx2=newext && Specify extensions to use. Default FoxBin2Prg extensions ends in '2' (see at the bottom)
|
||||
*----------------------------------------------------------------------------------------------------------------
|
||||
*-- Example configuration for SourceSafe compatibility:
|
||||
*extension: pj2=pja && Text file to PJX
|
||||
*extension: vc2=vca && Text file to VCX
|
||||
|
||||
BIN
foxbin2prg.exe
BIN
foxbin2prg.exe
Binary file not shown.
BIN
foxbin2prg.pjt
BIN
foxbin2prg.pjt
Binary file not shown.
BIN
foxbin2prg.pjx
BIN
foxbin2prg.pjx
Binary file not shown.
245
foxbin2prg.prg
245
foxbin2prg.prg
@@ -740,13 +740,13 @@ Try
|
||||
, .F., .F., .F., tcCFG_File )
|
||||
Catch To loEx
|
||||
*-- Esto solo es para errores en el INIT, ya que los demás se deben capturar y tratar antes.
|
||||
lnResp = loEx.ErrorNo
|
||||
Messagebox( 'Error ' + Transform(loEx.ErrorNo) + ', ' + loEx.Message + C_CR ;
|
||||
+ loEx.Procedure + ', Line ' + Transform(loEx.Lineno) + C_CR ;
|
||||
+ loEx.Details ;
|
||||
, 0+16+4096 ;
|
||||
, '' ;
|
||||
, 60000 )
|
||||
lnResp = loEx.ErrorNo
|
||||
Messagebox( 'Error ' + Transform(loEx.ErrorNo) + ', ' + loEx.Message + C_CR ;
|
||||
+ loEx.Procedure + ', Line ' + Transform(loEx.Lineno) + C_CR ;
|
||||
+ loEx.Details ;
|
||||
, 0+16+4096 ;
|
||||
, '' ;
|
||||
, 60000 )
|
||||
Endtry
|
||||
|
||||
AddProperty(_Screen, 'ExitCode', lnResp)
|
||||
@@ -1038,9 +1038,6 @@ Define Class c_foxbin2prg As Session
|
||||
n_MEM_Conversion_Support = 1
|
||||
c_DBF_Conversion_Included = ''
|
||||
c_DBF_Conversion_Excluded = ''
|
||||
*** DH 2021-03-04: added cOutputFolder and n_HomeDir properties
|
||||
cOutputFolder = '' && the folder to write files to (blank = same folder as source file)
|
||||
n_HomeDir = 1 && 0 = don't save HomeDir in PJ2, 1 = save HomeDir in PJ2
|
||||
*** DH 2021-03-04: added cOutputFolder and n_HomeDir properties
|
||||
cOutputFolder = '' && the folder to write files to (blank = same folder as source file)
|
||||
n_HomeDir = 1 && 0 = don't save HomeDir in PJ2, 1 = save HomeDir in PJ2
|
||||
@@ -2729,15 +2726,6 @@ Define Class c_foxbin2prg As Session
|
||||
Endif
|
||||
|
||||
|
||||
*** DH 2021-03-04: handle n_HomeDir configuration setting
|
||||
CASE LEFT( laConfig(m.I), 8 ) == LOWER('HomeDir:')
|
||||
lcValue = ALLTRIM( SUBSTR( laConfig(m.I), 9 ) )
|
||||
IF INLIST( lcValue, '0', '1' ) THEN
|
||||
lo_CFG.n_HomeDir = INT( VAL( lcValue ) )
|
||||
.writeLog( C_TAB + JUSTFNAME(lcConfigFile) + ' > HomeDir: ' + TRANSFORM(lo_CFG.n_HomeDir) )
|
||||
ENDIF
|
||||
*** DH 2021-03-04: end of new code
|
||||
|
||||
Endcase
|
||||
Endfor
|
||||
|
||||
@@ -3807,217 +3795,6 @@ Define Class c_foxbin2prg As Session
|
||||
Read Events
|
||||
lnCodError = 0
|
||||
|
||||
*!* Changed by: Lutz Scheffler 07.3.2021
|
||||
*!* change date="{^2021-03-07,18:44:00}"
|
||||
* added option to create config files with values
|
||||
Case m.lcType=='-C' And Vartype( m.tc_InputFile )='C'
|
||||
Local;
|
||||
lcText As String,;
|
||||
lcValue As String,;
|
||||
lcReturn As String,;
|
||||
lnLines As Number,;
|
||||
lnLine As Number,;
|
||||
lnOptions As Number,;
|
||||
lnOption As Number
|
||||
|
||||
lnOptions = 47
|
||||
|
||||
Local Array;
|
||||
laLines(1),;
|
||||
laOptions(m.lnOptions,3)
|
||||
|
||||
loLang = _Screen.o_FoxBin2Prg_Lang
|
||||
lcText = Strtran( '*' + Strtran( m.loLang.C_FOXBIN2PRG_SYNTAX_INFO_EXAMPLE_LOC_cfg, 0h0D0A, 0h0D0A + '*'), 0h0D0A + '*' + 0h0D0A, 0h0D0A0D0A)
|
||||
lnLines = Alines(laLines,m.lcText)
|
||||
|
||||
*now for each option
|
||||
laOptions(01,1) = "*ShowProgressbar:" && 0=Don't show, 1=Allways show, 2= Show only for multi-file processing
|
||||
laOptions(01,2) = ".n_ShowProgressbar"
|
||||
laOptions(01,3) = 0
|
||||
laOptions(02,1) = "*DontShowErrors:" && 0,1 Show message errors by default
|
||||
laOptions(02,2) = ".l_ShowErrors"
|
||||
laOptions(02,3) = 3
|
||||
laOptions(03,1) = "*NoTimestamps:" && 0,1 Clear timestamps by default for minimize differences
|
||||
laOptions(03,2) = ".l_NoTimestamps"
|
||||
laOptions(03,3) = 1
|
||||
laOptions(04,1) = "*Debug:" && 0,1 Don't Activate individual <file>.Log by default
|
||||
laOptions(04,2) = ".n_Debug"
|
||||
laOptions(04,3) = 0
|
||||
laOptions(05,1) = "*BodyDevInfo:" && 0,1 [0=Don't keep DevInfo for body pjx records], 1=Keep DevInfo
|
||||
laOptions(05,2) = ".n_BodyDevInfo"
|
||||
laOptions(05,3) = 0
|
||||
laOptions(06,1) = "*ExtraBackupLevels:" && n By default 1 BAK is created. With this you can make more .N.BAK, or none
|
||||
laOptions(06,2) = ".n_ExtraBackupLevels"
|
||||
laOptions(06,3) = 0
|
||||
laOptions(07,1) = "*ClearUniqueID:" && 0,1 0=Keep UniqueID in text files, 1=Clear Unique ID. Useful for Diff and Merge
|
||||
laOptions(07,2) = ".l_ClearUniqueID"
|
||||
laOptions(07,3) = 1
|
||||
laOptions(08,1) = "*ClearDBFLastUpdate:" && 0,1 0=Keep DBF LastUpdate, 1=Clear DBF LastUpdate. Useful for Diff.
|
||||
laOptions(08,2) = ".l_ClearDBFLastUpdate"
|
||||
laOptions(08,3) = 1
|
||||
laOptions(09,1) = "*OptimizeByFilestamp:" && 0,1,2 1=Optimize file regeneration depending on file timestamp. Dangerous while working with branches!
|
||||
laOptions(09,2) = ".n_OptimizeByFilestamp"
|
||||
laOptions(09,3) = 0
|
||||
laOptions(10,1) = "*RemoveNullCharsFromCode:" && 0,1 1=.t. 1=Drop NULL chars from source code
|
||||
laOptions(10,2) = ".l_RemoveNullCharsFromCode"
|
||||
laOptions(10,3) = 1
|
||||
laOptions(11,1) = "*RemoveZOrderSetFromProps:" && 0,1 1=.t. 0=Do not remove ZOrderSet property from object, 1=Remove ZOrderSet property from object
|
||||
laOptions(11,2) = ".l_RemoveZOrderSetFromProps"
|
||||
laOptions(11,3) = 1
|
||||
laOptions(12,1) = "*Language:" && Language of shown messages and LOGs. EN=English, FR=French, ES=Español, DE=German, Not defined = AUTOMATIC [DEFAULT]
|
||||
laOptions(12,2) = ".c_Language_In"
|
||||
laOptions(12,3) = 0
|
||||
laOptions(13,1) = "*ExcludeDBFAutoincNextval:" && 0,1 [0=Do not exclude this value from db2], 1=Exclude this value from db2
|
||||
laOptions(13,2) = ".n_ExcludeDBFAutoincNextval"
|
||||
laOptions(13,3) = 0
|
||||
laOptions(14,1) = "*PRG_Compat_Level:" && n [0=Legacy], 1=Use HELPSTRING as Class Procedure comment
|
||||
laOptions(14,2) = ".n_PRG_Compat_Level"
|
||||
laOptions(14,3) = 0
|
||||
laOptions(15,1) = "*HomeDir:" && 0,1 0 = don't save HomeDir in PJ2, [1 = save HomeDir in PJ2]
|
||||
laOptions(15,2) = ".n_HomeDir"
|
||||
laOptions(15,3) = 0
|
||||
laOptions(16,1) = "*PJX_Conversion_Support:" && n 0=No support, 1=Generate TXT only (Diff), 2=Generate TXT and BIN (Merge)
|
||||
laOptions(16,2) = ".PJX_Conversion_Support"
|
||||
laOptions(16,3) = 0
|
||||
laOptions(17,1) = "*VCX_Conversion_Support:" && n 0=No support, 1=Generate TXT only (Diff), 2=Generate TXT and BIN (Merge)
|
||||
laOptions(17,2) = ".VCX_Conversion_Support"
|
||||
laOptions(17,3) = 0
|
||||
laOptions(18,1) = "*SCX_Conversion_Support:" && n 0=No support, 1=Generate TXT only (Diff), 2=Generate TXT and BIN (Merge)
|
||||
laOptions(18,2) = ".SCX_Conversion_Support"
|
||||
laOptions(18,3) = 0
|
||||
laOptions(19,1) = "*FRX_Conversion_Support:" && n 0=No support, 1=Generate TXT only (Diff), 2=Generate TXT and BIN (Merge)
|
||||
laOptions(19,2) = ".FRX_Conversion_Support"
|
||||
laOptions(19,3) = 0
|
||||
laOptions(20,1) = "*LBX_Conversion_Support:" && n 0=No support, 1=Generate TXT only (Diff), 2=Generate TXT and BIN (Merge)
|
||||
laOptions(20,2) = ".LBX_Conversion_Support"
|
||||
laOptions(20,3) = 0
|
||||
laOptions(21,1) = "*MNX_Conversion_Support:" && n 0=No support, 1=Generate TXT only (Diff), 2=Generate TXT and BIN (Merge)
|
||||
laOptions(21,2) = ".MNX_Conversion_Support"
|
||||
laOptions(21,3) = 0
|
||||
laOptions(22,1) = "*FKY_Conversion_Support:" && n 0=No support, 1=Generate TXT only (Diff)
|
||||
laOptions(22,2) = ".FKY_Conversion_Support"
|
||||
laOptions(22,3) = 0
|
||||
laOptions(23,1) = "*MEM_Conversion_Support:" && 0=No support, 1=Generate TXT only (Diff)
|
||||
laOptions(23,2) = ".MEM_Conversion_Support"
|
||||
laOptions(23,3) = 0
|
||||
laOptions(24,1) = "*DBC_Conversion_Support:" && 0=No support, 1=Generate TXT only (Diff), 2=Generate TXT and BIN (Merge)
|
||||
laOptions(24,2) = ".DBC_Conversion_Support"
|
||||
laOptions(24,3) = 0
|
||||
laOptions(25,1) = "*DBF_Conversion_Support:" && n 0=No support, 1=Generate Header TXT only (Diff), 2=Generate Header TXT and BIN (Merge/Only Structure!), 4=Generate TXT with DATA (Diff), 8=Export and Import DATA (Merge/Structure & Data)
|
||||
laOptions(25,2) = ".DBF_Conversion_Support"
|
||||
laOptions(25,3) = 0
|
||||
laOptions(26,1) = "*DBF_Conversion_Included:" && n If DBF_Conversion_Support:4, you can specify multiple filemasks: www,fb2p_free.dbf
|
||||
laOptions(26,2) = ".DBF_Conversion_Included"
|
||||
laOptions(26,3) = 0
|
||||
laOptions(27,1) = "*DBF_Conversion_Excluded:" && n If DBF_Conversion_Support:4, you can specify multiple filemasks: www,fb2p_free.dbf
|
||||
laOptions(27,2) = ".DBF_Conversion_Excluded"
|
||||
laOptions(27,3) = 0
|
||||
laOptions(28,1) = "*OldFilesPerDBC:" && 0,1 1=.t. 1=Turns the File per DBC options on, 0 uses the old UseClassPerFile etc settings.
|
||||
laOptions(28,2) = ".l_OldFilesPerDBC"
|
||||
laOptions(28,3) = 1
|
||||
laOptions(29,1) = "*UseFilesPerDBC:" && 0,1 0=One database dc2 file, 1=Multiple file.*.*.dc2 files
|
||||
laOptions(29,2) = ".n_UseFilesPerDBC"
|
||||
laOptions(29,3) = 0
|
||||
laOptions(30,1) = "*RedirectFilePerDBCToMain:" && 0,1 1=.t. 0=Don't redirect to file.dc2, 1=Redirect to file.tx2 when selecting file.item.*.dc2
|
||||
laOptions(30,2) = ".l_RedirectFilePerDBCToMain"
|
||||
laOptions(30,3) = 1
|
||||
laOptions(31,1) = "*ItemPerDBCCheck:" && 0,1 1=.t. 0=Don't check file.item.*.dc2 inclusion, 1=Check file.item.*.dc2 inclusion
|
||||
laOptions(31,2) = ".l_ItemPerDBCCheck"
|
||||
laOptions(31,3) = 1
|
||||
laOptions(32,1) = "*DBF_BinChar_Base64:" && 0,1 1=.t. 0=For character type fields, if NoCPTrans 0=do not transform, 1=use Base64 transform (default)
|
||||
laOptions(32,2) = ".l_DBF_BinChar_Base64"
|
||||
laOptions(32,3) = 1
|
||||
laOptions(33,1) = "*DBF_IncludeDeleted:" && 0,1 1=.t. 0=Do not include deleted records (default), 1=Include deleted records
|
||||
laOptions(33,2) = ".l_DBF_IncludeDeleted"
|
||||
laOptions(33,3) = 1
|
||||
laOptions(34,1) = "*UseClassPerFile:" && n 0=One library tx2 file, 1=Multiple file.class.tx2 files, 2=Multiple file.baseclass.class.tx2 files
|
||||
laOptions(34,2) = ".n_UseClassPerFile"
|
||||
laOptions(34,3) = 0
|
||||
laOptions(35,1) = "*RedirectClassPerFileToMain:" && 0,1 1=.t. 0=Don't redirect to file.tx2, 1=Redirect to file.tx2 when selecting file.class.tx2
|
||||
laOptions(35,2) = ".l_RedirectClassPerFileToMain"
|
||||
laOptions(35,3) = 1
|
||||
laOptions(36,1) = "*RedirectClassType:" && 0,1,2 For classes created with UseClassPerFile>0 in the form file[.baseclass].class.tx2
|
||||
laOptions(36,2) = ".n_RedirectClassType"
|
||||
laOptions(36,3) = 0
|
||||
laOptions(37,1) = "*ClassPerFileCheck:" && 0,1 1=.t. 0=Don't check file.class.tx2 inclusion, 1=Check file.class.tx2 inclusion
|
||||
laOptions(37,2) = ".l_ClassPerFileCheck"
|
||||
laOptions(37,3) = 1
|
||||
laOptions(38,1) = "*extension: pj2=" && ext Text file to PJX
|
||||
laOptions(38,2) = ".c_pj2"
|
||||
laOptions(38,3) = 2
|
||||
laOptions(39,1) = "*extension: vc2=" && ext Text file to VCX
|
||||
laOptions(39,2) = ".c_vc2"
|
||||
laOptions(39,3) = 2
|
||||
laOptions(40,1) = "*extension: sc2=" && ext Text file to SCX
|
||||
laOptions(40,2) = ".c_sc2"
|
||||
laOptions(40,3) = 2
|
||||
laOptions(41,1) = "*extension: fr2=" && ext Text file to FRX
|
||||
laOptions(41,2) = ".c_fr2"
|
||||
laOptions(41,3) = 2
|
||||
laOptions(42,1) = "*extension: lb2=" && ext Text file to LBX
|
||||
laOptions(42,2) = ".c_lb2"
|
||||
laOptions(42,3) = 2
|
||||
laOptions(43,1) = "*extension: mn2=" && ext Text file to MNX
|
||||
laOptions(43,2) = ".c_mn2"
|
||||
laOptions(43,3) = 2
|
||||
laOptions(44,1) = "*extension: db2=" && ext Text file to DBF
|
||||
laOptions(44,2) = ".c_db2"
|
||||
laOptions(44,3) = 2
|
||||
laOptions(45,1) = "*extension: dc2=" && ext Text file to DBC
|
||||
laOptions(45,2) = ".c_dc2"
|
||||
laOptions(45,3) = 2
|
||||
laOptions(46,1) = "*extension: fk2=" && ext Text file to FKY
|
||||
laOptions(46,2) = ".c_fk2"
|
||||
laOptions(46,3) = 2
|
||||
laOptions(47,1) = "*extension: me2=" && ext Text file to MEM
|
||||
laOptions(47,2) = ".c_me2"
|
||||
laOptions(47,3) = 2
|
||||
|
||||
For lnOption = 1 To m.lnOptions
|
||||
lnLine = Ascan( m.laLines , m.laOptions( m.lnOption, 1 ), 1, -1, 1, 4)
|
||||
If m.lnLine >0 Then
|
||||
lcText = m.laLines( m.lnLine )
|
||||
lcValue = Strextract( m.lcText , m.laOptions( m.lnOption, 1 ), '&'+'&' ,1 , 3)
|
||||
Do Case
|
||||
Case m.laOptions( m.lnOption, 3 ) = 0
|
||||
lcReturn = Padr(' ' + Transform( Evaluate( m.laOptions( m.lnOption, 2 ) ) ), Len(m.lcValue) + 1 )
|
||||
|
||||
Case m.laOptions( m.lnOption, 3 ) = 1
|
||||
lcReturn = Padr(' ' + Iif ( Evaluate( m.laOptions( m.lnOption, 2 )), '1', '0' ), Len(m.lcValue) + 1 )
|
||||
|
||||
Case m.laOptions( m.lnOption, 3 ) = 2
|
||||
lcReturn = Padr(Evaluate( m.laOptions( m.lnOption, 2 )), Len(m.lcValue) + 1 )
|
||||
|
||||
Case m.laOptions( m.lnOption, 3 ) = 3
|
||||
lcReturn = Padr(' ' + Iif ( Evaluate( m.laOptions( m.lnOption, 2 )), '0', '1' ), Len(m.lcValue) + 1 )
|
||||
|
||||
OTHERWISE
|
||||
* not defined. loop
|
||||
Loop
|
||||
|
||||
Endcase
|
||||
laLines( m.lnLine ) = Substr(Strtran(m.laLines( m.lnLine ) , m.lcValue, m.lcReturn), 2 )
|
||||
|
||||
Endif &&lnLine >0
|
||||
|
||||
Endfor &&lnOption
|
||||
|
||||
lcText = ''
|
||||
|
||||
lnLines = m.lnLines+1
|
||||
Dimension;
|
||||
M.laLines( m.lnLines )
|
||||
|
||||
Ains(m.laLines,4)
|
||||
laLines( 4 ) = Textmerge( m.loLang.C_FOXBIN2PRG_SYNTAX_INFO_EXAMPLE_LOC_Header4 )
|
||||
For lnLine = 1 To m.lnLines
|
||||
lcText = m.lcText+ m.laLines( m.lnLine )+0h0D0A
|
||||
Endfor &&lnLine
|
||||
|
||||
Strtofile( m.lcText, m.tc_InputFile )
|
||||
|
||||
*!* /Changed by: Lutz Scheffler 07.3.2021
|
||||
|
||||
Otherwise
|
||||
*-- EJECUCIÓN NORMAL
|
||||
|
||||
@@ -30446,7 +30223,6 @@ Define Class CL_LANG As Custom
|
||||
<<>>BackgroundImage: <cFile> && Backgroundimage for process form. Empty for empty Background. File not found uses default.
|
||||
<<>>HomeDir: 1 && 0 = don't save HomeDir in PJ2, [1 = save HomeDir in PJ2]
|
||||
<<>>----------------------------------------------------------------------------------------------------------------
|
||||
<<>>HomeDir: 1 && 0 = don't save HomeDir in PJ2, [1 = save HomeDir in PJ2]
|
||||
<<>>
|
||||
<<>>-- Conversion operation by type
|
||||
<<>>PJX_Conversion_Support: 2 && 0=No support, 1=Generate TXT only (Diff), 2=Generate TXT and BIN (Merge)
|
||||
@@ -30516,7 +30292,6 @@ Define Class CL_LANG As Custom
|
||||
<<>>
|
||||
<<>>-- Text file extensions
|
||||
<<>>extension: tx2=newext && Specify extensions to use. Default FoxBin2Prg extensions ends in '2' (see at the bottom)
|
||||
<<>>----------------------------------------------------------------------------------------------------------------
|
||||
<<>>-- Example configuration for SourceSafe compatibility:
|
||||
<<>>extension: pj2=pja && Text file to PJX
|
||||
<<>>extension: vc2=vca && Text file to VCX
|
||||
@@ -30698,7 +30473,6 @@ Define Class CL_LANG As Custom
|
||||
<<>>BackgroundImage: <cFile> && Backgroundimage for process form. Empty for empty Background. File not found uses default.
|
||||
<<>>HomeDir: 1 && 0 = don't save HomeDir in PJ2, [1 = save HomeDir in PJ2]
|
||||
<<>>----------------------------------------------------------------------------------------------------------------
|
||||
<<>>HomeDir: 1 && 0 = don't save HomeDir in PJ2, [1 = save HomeDir in PJ2]
|
||||
<<>>
|
||||
<<>>-- Conversion operation by type
|
||||
<<>>PJX_Conversion_Support: 2 && 0=No support, 1=Generate TXT only (Diff), 2=Generate TXT and BIN (Merge)
|
||||
@@ -30768,7 +30542,6 @@ Define Class CL_LANG As Custom
|
||||
<<>>
|
||||
<<>>-- Text file extensions
|
||||
<<>>extension: tx2=newext && Specify extensions to use. Default FoxBin2Prg extensions ends in '2' (see at the bottom)
|
||||
<<>>----------------------------------------------------------------------------------------------------------------
|
||||
<<>>-- Example configuration for SourceSafe compatibility:
|
||||
<<>>extension: pj2=pja && Text file to PJX
|
||||
<<>>extension: vc2=vca && Text file to VCX
|
||||
@@ -30961,7 +30734,6 @@ Define Class CL_LANG As Custom
|
||||
<<>>BackgroundImage: <cFile> && Hintergrundbild für das Formular zur Fortschrittsanzeige.
|
||||
<<>> && Leer erzeugt kein Hintergrundbild., Wird die Datei nicht gefunden, wird der Standardhintergrund verwendet.
|
||||
<<>>HomeDir: 1 && 0 = Die Eigenschaft HomeDir wird nicht in die PJ2 gespeichert, [1 = Die Eigenschaft wird gespeichert]
|
||||
<<>>HomeDir: 1 && 0 = Die Eigenschaft HomeDir wird nicht in die PJ2 gespeichert, [1 = Die Eigenschaft wird gespeichert]
|
||||
<<>>
|
||||
<<>>----------------------------------------------------------------------------------------------------------------
|
||||
<<>>-- Konvertierungs Optionen:
|
||||
@@ -31041,6 +30813,7 @@ Define Class CL_LANG As Custom
|
||||
<<>>DBF_IncludeDeleted: 0 && 0=Ohne gelöschte Datensätze (default), 1=Mit gelöschten Datensätzen
|
||||
<<>> && Diese Option kann auch per Tabelle gesetzt werden.
|
||||
<<>>----------------------------------------------------------------------------------------------------------------
|
||||
<<>>
|
||||
<<>>-- Text-Datei Endungen
|
||||
<<>>extension: tx2=newext && Umdefinition der Dateiendung der Textdateien. Die vordefinierten Endungen enden mit '2' (Beispiel siehe Ende dieser Datei)
|
||||
<<>>-- Beispiel für geänderte Textdatei Endungen, hier für SourceSafe Kompatibiltät:
|
||||
@@ -31235,7 +31008,6 @@ Define Class CL_LANG As Custom
|
||||
<<>>BackgroundImage: <cFile> && Backgroundimage for process form. Empty for empty Background. File not found uses default.
|
||||
<<>>HomeDir: 1 && 0 = don't save HomeDir in PJ2, [1 = save HomeDir in PJ2]
|
||||
<<>>----------------------------------------------------------------------------------------------------------------
|
||||
<<>>HomeDir: 1 && 0 = don't save HomeDir in PJ2, [1 = save HomeDir in PJ2]
|
||||
<<>>
|
||||
<<>>-- Conversion operation by type
|
||||
<<>>PJX_Conversion_Support: 2 && 0=No support, 1=Generate TXT only (Diff), 2=Generate TXT and BIN (Merge)
|
||||
@@ -31305,7 +31077,6 @@ Define Class CL_LANG As Custom
|
||||
<<>>
|
||||
<<>>-- Text file extensions
|
||||
<<>>extension: tx2=newext && Specify extensions to use. Default FoxBin2Prg extensions ends in '2' (see at the bottom)
|
||||
<<>>----------------------------------------------------------------------------------------------------------------
|
||||
<<>>-- Example configuration for SourceSafe compatibility:
|
||||
<<>>extension: pj2=pja && Text file to PJX
|
||||
<<>>extension: vc2=vca && Text file to VCX
|
||||
|
||||
Reference in New Issue
Block a user