From 7ca1930b2ef935521b14e47cf6605314c4f1b10e Mon Sep 17 00:00:00 2001 From: Lutz Date: Sun, 3 Sep 2023 15:41:58 +0200 Subject: [PATCH] New option to control forms Bugfix for menu recreation --- Create_FoxBin2Prg.cfg | 26 +++++++++++++++++++ FOXBIN2PRG.DBF.CFG.TXT | 12 +++++++++ README.md | 4 +-- TESTS/DATOS_READONLY/fb2p_dbc.dbc | Bin 9463 -> 9463 bytes TESTS/DATOS_READONLY/fb2p_dbc.dct | Bin 56185 -> 56767 bytes docs/ChangeLog.md | 6 +++-- docs/FoxBin2Prg_Internals.md | 40 ++++++++++++++++++++++-------- foxbin2prg.cfg.txt | 37 +++++++++++++++++++++++---- foxbin2prg.pj2 | 2 +- foxbin2prg.prg | 6 ++--- 10 files changed, 110 insertions(+), 23 deletions(-) create mode 100644 FOXBIN2PRG.DBF.CFG.TXT diff --git a/Create_FoxBin2Prg.cfg b/Create_FoxBin2Prg.cfg index 965026d..4e8b3cb 100644 --- a/Create_FoxBin2Prg.cfg +++ b/Create_FoxBin2Prg.cfg @@ -90,6 +90,32 @@ ClassPerFileCheck: 0 && Check, if files listed in the main file of a * && Ignored for RedirectClassType: 2 *- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +*-- FORM options +*- Form per file options (UseFormSettings: 1) +UseFormSettings: 0 && 1=Turns the File per SCX options on, 0 uses the old UseClassPerFile etc settings. +* && Options below will only read if UseFormSettings is set 1 before! +* && If UseFormSettings is set 0 later, all setting will be lost +UseFormPerFile: 0 && Determines how a form will handle included objects +* && 0 One Form.sc2 file +* && 1 Multiple Form.Obj.sc2 files +* && 2 Multiple Form.baseclass.Obj.sc2 files +RedirectFormPerFileToMain: 0 && When regenerating binary files, determine target file +* && 0 Don't redirect to Form.scx +* && 1 Redirect to Form.scx when selecting Form[.baseclass].Obj.sc2 +* && RedirectFormType: 1 has precedence +RedirectFormType: 0 && For classes created with UseFormPerFile>0 in the form Form[.baseclass].Obj.sc2 +* && Those files could be imported like Form.sc2::Class::import or like Form[.baseclass].Obj.sc2 +* && For the second form: +* && 0 Redirect Form[.baseclass].Obj.sc2 to Form.SCX and add / replace all other classes of this library +* && 1 Redirect Form[.baseclass].Obj.sc2 to Form[.baseclass].Obj.SCX and do not touch Form.SCX +* && 2 Redirect Form[.baseclass].Obj.sc2 to Form.SCX and do not touch other classes of Form.SCX +FormPerFileCheck: 0 && Check, if files listed in the main file of a library or form will be included +* && 0 Don't check file inclusion +* && 1 Check Form[.baseclass].Obj.sc2 inclusion +* && Only used if import file is in Form[.baseclass].Obj.sc2 syntax +* && Ignored for RedirectFormType: 2 +*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + *-- DBC options *- File per DBC options (UseFilesPerDBC: 1) OldFilesPerDBC: 1 && 1=Turns the File per DBC options on, 0 uses the old UseClassPerFile etc settings. diff --git a/FOXBIN2PRG.DBF.CFG.TXT b/FOXBIN2PRG.DBF.CFG.TXT new file mode 100644 index 0000000..d7136e5 --- /dev/null +++ b/FOXBIN2PRG.DBF.CFG.TXT @@ -0,0 +1,12 @@ +*################################################################################################################ +*-- Individual DBF configuration file (syntax: filename.dbf.cfg) Defaults see FoxBin2prg.cfg +*Version: v1.20.05 +***************************************************************************************************************** + +*DBF_Conversion_Support: <0,1,2,4,8> && 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) +*DBF_Conversion_Order: && Field expresion. ie: name+str(age,3) +*DBF_Conversion_Condition: && Logical expression. ie: age > 10 AND NOT DELETED() +*DBF_IndexList: && comma delimited list of additonal non structural index files, cdx or idx +*DBF_BinChar_Base64: <0,1> && For character type fields, if NoCPTrans 0=do not transform, 1=use Base64 transform +*DBF_IncludeDeleted: <0,1> && 0=Do not include deleted records, 1=Include deleted records +* \ No newline at end of file diff --git a/README.md b/README.md index 672d70d..3a27117 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# FoxBin2Prg 1.20.04 +# FoxBin2Prg 1.20.05 **Binary/Text Converting program for Microsoft Visual FoxPro** ## Lutz Scheffler @@ -153,4 +153,4 @@ See [issue #93](https://github.com/fdbozzo/foxbin2prg/issues/93). ## Usage For usage see [documentation](./docs/FoxBin2Prg.md) -Last changed: _2023/09/01_ +Last changed: _2023/09/03_ diff --git a/TESTS/DATOS_READONLY/fb2p_dbc.dbc b/TESTS/DATOS_READONLY/fb2p_dbc.dbc index ce732e54c716457506f7b748ac9e812cda1a0ab1..ea72182d3c2e6f33747da9c535ff5ba0b77be0f3 100644 GIT binary patch delta 21 dcmezF`Q4MnK%A3#Bg=LsrntMC_cB>20RUB02T=e3 delta 21 dcmezF`Q4MnK%A3tBg=LsCW+gd_cB>20RU4(2L}KE diff --git a/TESTS/DATOS_READONLY/fb2p_dbc.dct b/TESTS/DATOS_READONLY/fb2p_dbc.dct index df10421b8d14eac697598c4717f9ad1198333e5c..bd107ec42d956dd01ae22a28269333cb974a11fe 100644 GIT binary patch delta 36 scmeyljd}lWW)231yZad!7#KGSeqx-cz`2>3sqE%tfpV|S`o(`30q|N40RR91 delta 27 jcmdnLoB8K9W)231+m#Fq42&BEKQT^J;M~m2RCW^pg&7G0 diff --git a/docs/ChangeLog.md b/docs/ChangeLog.md index e4b7466..6b2c11a 100644 --- a/docs/ChangeLog.md +++ b/docs/ChangeLog.md @@ -24,10 +24,12 @@ _**Note:** you can click on the version number for downloading this version from | Rel.Date | Developer | Version | Details | | - | - | - | - | +| 2023/09/03 | LScheffler | [v1.20.05](https://github.com/lscheffler/foxbin2prg/releases/tag/v1.20.05) | **Bug Fix**: Problems recreating menu files (introduced with codepage) (LScheffler) | +| | | | Enhancement: Inserted options to allow splitting of SCX handling from VCX.1 | | 2023/09/01 | LScheffler | [v1.20.04](https://github.com/lscheffler/foxbin2prg/releases/tag/v1.20.04) | Enhancement: New option "tcDebug" for get_DirSettings method. | | | | | Enhancement: For better clearance, renamed setting AllowInheritance to InhibitInheritance. | | | | | Enhancement: The debug option set via parameter has precedence over value from config file. | -| | | | Enhancement: For debug option set via parameter only first valid call is used | +| | | | Enhancement: For debug option set via parameter only first valid call is used. | | 2023/08/31 | LScheffler | [v1.20.03](https://github.com/lscheffler/foxbin2prg/releases/tag/v1.20.03) | **Enhancement**: New option "tcCFG_File" for get_DirSettings method. | | 2023/08/31 | LScheffler | [v1.20.02](https://github.com/lscheffler/foxbin2prg/releases/tag/v1.20.02) | New option for parameter set config file to control the use of "regular" config files enhanced | | 2023/08/30 | LScheffler | [v1.20.01](https://github.com/lscheffler/foxbin2prg/releases/tag/v1.20.01) | **Bug Fix**: Some values of config file would not be read, if the inline comment "&&" was not in the line (LScheffler) | @@ -433,4 +435,4 @@ _**Note:** you can click on the version number for downloading this version from | 2013/11/22 | FDBOZZO | [v1.0](https://github.com/fdbozzo/foxbin2prg/tree/v1.0---pública) | Initial creation of clases on prg and support of VCX/SCX/PJX files | ---- -Last changed: _2023/09/01_ \ No newline at end of file +Last changed: _2023/09/02_ \ No newline at end of file diff --git a/docs/FoxBin2Prg_Internals.md b/docs/FoxBin2Prg_Internals.md index 284077f..7f1deaa 100644 --- a/docs/FoxBin2Prg_Internals.md +++ b/docs/FoxBin2Prg_Internals.md @@ -35,6 +35,7 @@ As far as possible these are the original documents. Changes are added where fun - [Complementary options for the UseClassPerFile setting](#complementary-options-for-the-useclassperfile-setting) - [RedirectClassPerFileToMain](#redirectclassperfiletomain) - [ClassPerFileCheck](#classperfilecheck) + - [Create File-Per-Form](create_file_per_form) - [Create File-Per-DBC](#create-file-per-dbc) - [Complementary options for the UseFilesPerDBC setting](#complementary-options-for-the-usefilesperdbc-setting) - [RedirectFilePerDBCToMain](#redirectfileperdbctomain) @@ -140,7 +141,8 @@ These are the FoxBin2Prg.cfg configuration file settings and their meaning: | | | 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,
1=Check file.class.vc2 inclusion
Only used if import file is in file[.baseclass].class.tx2 syntax.
Ignored for RedirectClassType: 2 | ||| -| UseFormSettings | _0_, 1 | 0=Old Style, like the class settings
1=Form style, special for form
This controls the use of the _UseFormPerFile_, _RedirectFormPerFileToMain_, _RedirectFormType_ and _FormPerFileCheck_ options.
Only if this option is set, the options will be read. | +| [UseFormSettings](create_file_per_form) + | _0_, 1 | 0=Old Style, like the class settings
1=Form style, special for form
This controls the use of the _UseFormPerFile_, _RedirectFormPerFileToMain_, _RedirectFormType_ and _FormPerFileCheck_ options.
Only if this option is set, the options will be read. | | UseFormPerFile | _0_, 1, 2 | 0=One library _Text_ file,
1=Multiple Form.Object.sc2 files,
2=Multiple Form.baseclass.Object.sc2 files
See [Create Class-Per-File](#create-class-per-file) | | [RedirectFormPerFileToMain:](#redirectclassperfiletomain:) | _0_, 1 | 0=Don't redirect to Form.scx,
1=Redirect to Form.scx when selecting Form.Object.sc2
RedirectClassType: 1 precedes this setting | | RedirectFormType | _0_, 1, 2 | For classes created with UseClassPerFile>0 in the form Form[.baseclass].Object.sx2 (scx only) | @@ -149,7 +151,7 @@ These are the FoxBin2Prg.cfg configuration file settings and their meaning: | | | 2=creates / refresh class in Form.SCX and do not touch other classes of Form.SCX | | [FormPerFileCheck](#classperfilecheck) | _0_, 1 | 0=Don't check Form.Object.sc2 inclusion,
1=Check Form.Object.sc2 inclusion
Only used if import file is in Form[.baseclass].Object.sc2 syntax.
Ignored for RedirectClassType: 2 | ||| -| OldFilesPerDBC | _0_, 1 | 0=Old Style,
1=New style
This controls the use of the _UseFilesPerDBC_, _RedirectFilePerDBCToMain_ and _ItemPerDBCCheck_ options.
Only if this option is set, the options will be read. | +| OldFilesPerDBC | _0_, 1 | 0=Old Style,
1=New style
This controls the use of the _UseFilesPerDBC_, _RedirectFilePerDBCToMain_ and _ItemPerDBCCheck_ options.
Only if this option is set, the **Form** options below will be read. | | | | 0=New version inactive, options follow:
UseFilesPerDBC=UseClassPerFile
RedirectFilePerDBCToMain=RedirectClassPerFileToMain
ItemPerDBCCheck=ClassPerFileCheck | | | | 1=New version active, options active | | | | Note: The options will be set to old style, if option is turned off. | @@ -443,10 +445,17 @@ 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, + +The exception are the group controlling the new style to split DBC files and the one for forms. +The options _UseFilesPerDBC_, _RedirectFilePerDBCToMain_ and _ItemPerDBCCheck_ will be ignored for DBC, 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. +Setting _OldFilesPerDBC_ to 1 will inhertit the values from the \*class\* options. +If _OldFilesPerDBC_ is set to 0 after it was active, the values of the three options are rejected at all and reset to the corresponding \*class\* values. +For Forms, options _UseFormPerFile_, _RedirectFormPerFileToMain_, _RedirectFormType_ and _FormPerFileCheck_ will be ignored, +if _UseFormSettings_ is set to 0. +Setting _UseFormSettings_ to 1 will inhertit the values from the \*class\* options. +If _UseFormSettings_ is set to 0 after it was active, the values of the four options are rejected at all and reset to the corresponding \*class\* values. + ### File Capitalization FoxBin2Prg takes care of file capitalization (their extension, specifically), @@ -533,9 +542,20 @@ If you don't use the redirect setting, an individual vcx/scx file will be genera This can be useful if you want to divide a big library in smaller pieces. #### Note -This is true for SCX files as well. SCX files may contain a form and a dataenvironment. -It will create sc2 files. - +By default, these settings are valid for SCX and DBC files as well. SCX files may expand to header, form and dataenvironment, and a DBC may be split into header and several files of the objects contained. +If you like finer and independend control over forms and databases, check +- [Create File-Per-Form](create_file_per_form) and +- [Create File-Per-DBC](#create-file-per-dbc) + +### Create File-Per-Form +Starting at 1.20.05 you can configure FoxBin2Prg to generate Form (sc2) files independent of classlibrary. +The major idea is, that the class settings to split a vcx into multiple files result into splitting a form(SCX into a form header, a from and a dataenvironment file, what might be overkill. (splitting classes is great, so one does not need to merge the whole lib, but a form is a form.) +To configure this, you must first enable it in foxbin2prg.cfg file: +```` +UseFormSettings: 1 +```` +The settings of the four options are similar to the one of the [class options](#create-class-per-file), except they are named \*Form\* instead of \*Class\*. + ### Create File-Per-DBC Starting at 1.19.55 you can configure FoxBin2Prg to generate one _Text_ file per dbc item using naming style "DatabaseName.item.name.dc2" with the value "1" @@ -566,7 +586,7 @@ annotated on DataBaseName.dc2 main file, otherwise no checking is made and when #### Note If you don't use the Redirect setting, an individual dbc file will be generated. There is no real use of this. - + ### FoxBin2Prg API With v1.19.42 version started an enhanced API support, making public methods that where only for internal use up to now. When using FoxBin2Prg as an object, you can access low level functionalities not available when using as external program, @@ -751,4 +771,4 @@ For options on integrating FoxBin2Prg with SCM tools, look at this topic: See [FoxBin2Prg and use with git](./FoxBin2Prg_git.md) ---- -Last changed: _2023/09/01_ \ No newline at end of file +Last changed: _2023/09/03_ \ No newline at end of file diff --git a/foxbin2prg.cfg.txt b/foxbin2prg.cfg.txt index 034829d..766ee41 100644 --- a/foxbin2prg.cfg.txt +++ b/foxbin2prg.cfg.txt @@ -1,6 +1,6 @@ *################################################################################################################ *FOXBIN2PRG.CFG configuration options: (If no values given, these are the DEFAULTS) -*Version: v1.20.04 +*Version: v1.20.05 ***************************************************************************************************************** * Note, configuration files will follow an inheritance. @@ -63,15 +63,16 @@ *---------------------------------------------------------------------------------------------------------------- *Setting for container files (not pjx) -*-- CLASS and FORM options (tx2 is to read as vc2 or sc2, VCX might be SCX) +*-- CLASS (, FORM and DBC) options (tx2 is to read as vc2 or sc2, VCX might be SCX) +*-- FORM and DBC options default to this settings, if not set otherwise. See below. *- Class per file options (UseClassPerFile: 1) *UseClassPerFile: 0 && Determines how a library (or form) will handle included class (or, for forms, objects) * && 0 One library.tx2 file * && 1 Multiple file.class.tx2 files * && 2 Multiple file.baseclass.class.tx2 files *RedirectClassPerFileToMain: 0 && When regenerating binary files, determine target file -* && 0 Don't redirect to file.tx2 -* && 1 Redirect to file.tx2 when selecting file[.baseclass].class.tx2 +* && 0 Don't redirect to file.vcx/scx +* && 1 Redirect to file.vcx/scx when selecting file[.baseclass].class.tx2 * && RedirectClassType: 1 has precedence *RedirectClassType: 0 && For classes created with UseClassPerFile>0 in the form file[.baseclass].class.tx2 * && Those files could be imported like file.tx2::Class::import or like file[.baseclass].class.tx2 @@ -86,11 +87,37 @@ * && Ignored for RedirectClassType: 2 *- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +*-- FORM options +*- Form per file options (UseFormSettings: 1) +*UseFormSettings: 0 && 1=Turns the File per SCX options on, 0 uses the old UseClassPerFile etc settings. +* && Options below will only read if UseFormSettings is set 1 before! +* && If UseFormSettings is set 0 later, all setting will be lost +*UseFormPerFile: 0 && Determines how a form will handle included objects +* && 0 One Form.sc2 file +* && 1 Multiple Form.Obj.sc2 files +* && 2 Multiple Form.baseclass.Obj.sc2 files +*RedirectFormPerFileToMain: 0 && When regenerating binary files, determine target file +* && 0 Don't redirect to Form.scx +* && 1 Redirect to Form.scx when selecting Form[.baseclass].Obj.sc2 +* && RedirectFormType: 1 has precedence +*RedirectFormType: 0 && For classes created with UseFormPerFile>0 in the form Form[.baseclass].Obj.sc2 +* && Those files could be imported like Form.sc2::Class::import or like Form[.baseclass].Obj.sc2 +* && For the second form: +* && 0 Redirect Form[.baseclass].Obj.sc2 to Form.SCX and add / replace all other classes of this library +* && 1 Redirect Form[.baseclass].Obj.sc2 to Form[.baseclass].Obj.SCX and do not touch Form.SCX +* && 2 Redirect Form[.baseclass].Obj.sc2 to Form.SCX and do not touch other classes of Form.SCX +*FormPerFileCheck: 0 && Check, if files listed in the main file of a library or form will be included +* && 0 Don't check file inclusion +* && 1 Check Form[.baseclass].Obj.sc2 inclusion +* && Only used if import file is in Form[.baseclass].Obj.sc2 syntax +* && Ignored for RedirectFormType: 2 +*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + *-- DBC options *- File per DBC options (UseFilesPerDBC: 1) *OldFilesPerDBC: 0 && 1=Turns the File per DBC options on, 0 uses the old UseClassPerFile etc settings. * && Options below will only read if OldFilesPerDBC is set 1 before! -* && If OldFilesPerDBC is set 0 later, alle setting will be lost +* && If OldFilesPerDBC is set 0 later, all setting will be lost *UseFilesPerDBC: 0 && 0=One database dc2 file, 1=Multiple file.*.*.dc2 files * && 0 creates only a file.dc2 with all DBC (file) data * && 1 creates a file.dc2 with DBC properties diff --git a/foxbin2prg.pj2 b/foxbin2prg.pj2 index 4b53c5f..1dbd432 100644 --- a/foxbin2prg.pj2 +++ b/foxbin2prg.pj2 @@ -26,7 +26,7 @@ _LegalTrademark = "MIT License" _ProductName = "FOXBIN2PRG" _MajorVer = "1" _MinorVer = "20" -_Revision = "4" +_Revision = "5" _LanguageID = "1034" _AutoIncrement = "0" * diff --git a/foxbin2prg.prg b/foxbin2prg.prg index b00f0ea..9c427b6 100644 --- a/foxbin2prg.prg +++ b/foxbin2prg.prg @@ -1,5 +1,5 @@ #DEFINE DN_FB2PRG_VERSION 1.20 -#DEFINE DC_FB2PRG_VERSION_REAL '1.20.04' +#DEFINE DC_FB2PRG_VERSION_REAL '1.20.05' *--------------------------------------------------------------------------------------------------- * Module.........: FOXBIN2PRG.PRG - FOR VISUAL FOXPRO 9.0 @@ -317,8 +317,8 @@ * 01/09/2023 LScheffler v1.20.04 Enhancement: For better clearance, renamed setting AllowInheritance to InhibitInheritance. * 01/09/2023 LScheffler v1.20.04 Enhancement: The debug option set via parameter has precedence over value from config file. * 01/09/2023 LScheffler v1.20.04 Enhancement: For debug option set via parameter only first valid call is used -* 02/09/2023 LScheffler v1.20.05 Bug Fix: problems recreating menu files (introduced with codepage) (LScheffler) -* 02/09/2023 LScheffler v1.20.05 Enhancement: inserted options to allow splitting of SCX handling from VCX +* 03/09/2023 LScheffler v1.20.05 Bug Fix: Problems recreating menu files (introduced with codepage) (LScheffler) +* 03/09/2023 LScheffler v1.20.05 Enhancement: Inserted options to allow splitting of SCX handling from VCX * * *---------------------------------------------------------------------------------------------------