From d9c502337759c850d87122e4f434f1d6014e6637 Mon Sep 17 00:00:00 2001 From: Lutz Date: Thu, 4 Mar 2021 18:36:11 +0100 Subject: [PATCH] Extension 1.19.56 Bug: On special setting for import in form file[.baseclass].class.vc2 Enhancement: New value 2 for option RedirectClassType. Alter single class for input form file[.baseclass].class.vc2 --- Documentacion/github/FoxBin2Prg_Changes.md | 4 +- Documentacion/github/FoxBin2Prg_Internals.md | 6 +- Documentacion/github/FoxBin2Prg_Run.md | 4 +- README.md | 6 +- foxbin2prg.cfg.txt | 28 +++--- foxbin2prg.pjt | Bin 680741 -> 680741 bytes foxbin2prg.pjx | Bin 7043 -> 7043 bytes foxbin2prg.prg | 97 +++++++++++++++++-- 8 files changed, 119 insertions(+), 26 deletions(-) diff --git a/Documentacion/github/FoxBin2Prg_Changes.md b/Documentacion/github/FoxBin2Prg_Changes.md index b16dbf7..7e35cb1 100644 --- a/Documentacion/github/FoxBin2Prg_Changes.md +++ b/Documentacion/github/FoxBin2Prg_Changes.md @@ -32,6 +32,8 @@ _**Note:** you can click on the version number for downloading this version from | Rel.Date | Developer | Version | Details | | - | - | - | - | +| 2021/03/04 | LScheffler | [v1.19.56]() | **Feature**: New value 2 for option RedirectClassType = 2, just process the single class for input in form file[.baseclass].class.vc2 | +| | | | **Bug Fix**:
Inputfile in form classlib.class.vc2 AND RedirectClassType = 1 and Execute param tcRecompile = 1
generates classlib.class.vcx and tries to recompile classlib.vcx
fails silent if classlib.vcx exists (compiles wrong lib), with message if not. | | 2021/02/21 | LScheffler | [v1.19.55]() | **Doc**: Documentation from CodePlex integrated | | | | | **Feature**: added option to create config file template | | | | | **Doc**: Info screen-doc improved | @@ -368,4 +370,4 @@ _**Note:** you can click on the version number for downloading this version from This project is part of [VFPX](https://vfpx.github.io/). ---- -Last changed: _2021/03/03_ ![Picture](./pictures/vfpxpoweredby_alternative.gif) \ No newline at end of file +Last changed: _2021/03/04_ ![Picture](./pictures/vfpxpoweredby_alternative.gif) \ No newline at end of file diff --git a/Documentacion/github/FoxBin2Prg_Internals.md b/Documentacion/github/FoxBin2Prg_Internals.md index 420f3f2..6113bfb 100644 --- a/Documentacion/github/FoxBin2Prg_Internals.md +++ b/Documentacion/github/FoxBin2Prg_Internals.md @@ -109,6 +109,10 @@ These are the FoxBin2Prg.cfg configuration file settings and their meaning: | | | 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 | +| 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 | | RedirectFilePerDBCToMain | _0_, 1 | 0=Don't redirect to file.dc2,
1=Redirect to file.tx2 when selecting file.item.*.dc2
**Only if OldFilesPerDBC is 1** | | ItemPerDBCCheck | _0_, 1 | 0=Don't check file.item.*.dc2 inclusion,
1=Check file.item.*.dc2 inclusion
**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)
**Note:** This can be [changed per table](#configuration-file-per-table). | @@ -657,4 +661,4 @@ For options on integrating FoxBin2Prg with SCM tools, look at this topic: This project is part of [VFPX](https://vfpx.github.io/). ---- -Last changed: _2021/03/03_ ![Picture](./pictures/vfpxpoweredby_alternative.gif) \ No newline at end of file +Last changed: _2021/03/04_ ![Picture](./pictures/vfpxpoweredby_alternative.gif) \ No newline at end of file diff --git a/Documentacion/github/FoxBin2Prg_Run.md b/Documentacion/github/FoxBin2Prg_Run.md index 19d10f6..45bb7dd 100644 --- a/Documentacion/github/FoxBin2Prg_Run.md +++ b/Documentacion/github/FoxBin2Prg_Run.md @@ -140,6 +140,8 @@ Return value via _ErrorLevel_ is 0=OK, 1=Error. | `DO FOXBIN2PRG.PRG WITH "\proj.pj2", "*"` | Generates the _Binary_ files for all the files in the PJ2 | | `DO FOXBIN2PRG.PRG WITH "\proj.pjx", "*-"` | Generates the _Text_ files for all the files in the PJX, excluding the PJX | | `DO FOXBIN2PRG.PRG WITH "\file.vcx::cus_client"` | Generates only the _Text_ version of the individual class cus_client of file.vcx (with UseClassPerFile:1 or 2) | +| `DO FOXBIN2PRG.PRG WITH "\file.cus_client.vc2"` | Generates only the _Binary_ version of the individual class cus_client of file.vcx (with UseClassPerFile:1 and RedirectClassType:2) | +| `DO FOXBIN2PRG.PRG WITH "\file.vc2::cus_client::import"` | Generates only the _Binary_ version of the individual class cus_client of file.vcx (with UseClassPerFile:1) | ## Explorer SendTo To use _FoxBin2Prg_ from the File Explorer, you can create 3 shortcuts of FoxBin2Prg.exe and move them to "SendTo" folder on your Windows profile. @@ -159,4 +161,4 @@ FoxBin2Prg.lnk \foxbin2prg.exe "INTERACTIVE-SHOWMSG" This project is part of [VFPX](https://vfpx.github.io/). ---- -Last changed: _2021/03/03_ ![Picture](./pictures/vfpxpoweredby_alternative.gif) \ No newline at end of file +Last changed: _2021/03/04_ ![Picture](./pictures/vfpxpoweredby_alternative.gif) \ No newline at end of file diff --git a/README.md b/README.md index 3878977..03a65a8 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# FoxBin2Prg v1.19.55 +# FoxBin2Prg v1.19.56 **Binary/Text Converting program for Microsoft Visual FoxPro** ## Lutz Scheffler @@ -171,6 +171,7 @@ Fixes only are in the fork branch of this repo. | Minor translations | | Conversion dbf -> prg, error if only test mode (toFoxBin2Prg.l_ProcessFiles is false) | | DBF_Conversion_Condition, problem with macro expansion | +| Bug on special setting for import in form file[.baseclass].class.vc2 | ### Features @@ -186,6 +187,7 @@ Fixes only are in the fork branch of this repo. | Inserted option RedirectFilePerDBCToMain to split DBC processing from vcx / scx | | Inserted option ItemPerDBCCheck to split DBC processing from vcx / scx | | added option to create config file template | +| New value 2 for option RedirectClassType. Alter single class for input form file[.baseclass].class.vc2 | --- @@ -199,4 +201,4 @@ This folder containes the files necessary to run FoxBin2Prg.prg or to create the For usage see [documentation](./Documentacion/github/FoxBin2prg.md) ---- -Last changed: _2021/03/03_ ![Picture](./pictures/vfpxpoweredby_alternative.gif) \ No newline at end of file +Last changed: _2021/03/04_ ![Picture](./pictures/vfpxpoweredby_alternative.gif) \ No newline at end of file diff --git a/foxbin2prg.cfg.txt b/foxbin2prg.cfg.txt index 3f3ca4e..d9f859d 100644 --- a/foxbin2prg.cfg.txt +++ b/foxbin2prg.cfg.txt @@ -52,19 +52,25 @@ *- Class per file options (UseClassPerFile: 1) *UseClassPerFile: 0 && 0=One library tx2 file, 1=Multiple file.class.tx2 files, 2=Multiple file.baseclass.class.tx2 files *RedirectClassPerFileToMain: 0 && 0=Don't redirect to file.tx2, 1=Redirect to file.tx2 when selecting file.class.tx2 +*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 +* && For the second form: +* && 0 Redirect file[.baseclass].class.tx2 to file.VCX and add / replace all other classes of this library +* && 1 Redirect file[.baseclass].class.tx2 to file[.baseclass].class.VCX and do not touch file.VCX +* && 2 Redirect file[.baseclass].class.tx2 to file.VCX and do not touch other classes of file.VCX *ClassPerFileCheck: 0 && 0=Don't check file.class.tx2 inclusion, 1=Check file.class.tx2 inclusion *-- Example configuration for SourceSafe compatibility: -*extension: pj2=pja && Text file to PJX -*extension: vc2=vca && Text file to VCX -*extension: sc2=sca && Text file to SCX -*extension: fr2=fra && Text file to FRX -*extension: lb2=lba && Text file to LBX -*extension: mn2=mna && Text file to MNX -*extension: db2=dba && Text file to DBF -*extension: dc2=dca && Text file to DBC -*-- Additional extensions -*extension: fk2=fkx && Text file to FKY -*extension: me2=fkx && Text file to MEM +*extension: pj2=pja && Text file to PJX +*extension: vc2=vca && Text file to VCX +*extension: sc2=sca && Text file to SCX +*extension: fr2=fra && Text file to FRX +*extension: lb2=lba && Text file to LBX +*extension: mn2=mna && Text file to MNX +*extension: db2=dba && Text file to DBF +*extension: dc2=dca && Text file to DBC +*-- Additional extensions +*extension: fk2=fkx && Text file to FKY +*extension: me2=fkx && Text file to MEM * \ No newline at end of file diff --git a/foxbin2prg.pjt b/foxbin2prg.pjt index 9539be454e760d8418fabda6378a2dd719236b22..048decb9133a79714344341f68e17c17b761c876 100644 GIT binary patch delta 66 zcmZ2_Ompcm%?%cu9A*p*42A~ACKCmvo1;0~qd6IYm @@ -844,8 +848,8 @@ Define Class c_foxbin2prg As Session Dimension a_ProcessedFiles(1, 6) Protected n_CFG_Actual, l_Main_CFG_Loaded, o_Configuration, l_CFG_CachedAccess *-- - n_FB2PRG_Version = 1.21 - c_FB2PRG_Version_Real = '1.19.55' + n_FB2PRG_Version = 1.19 + c_FB2PRG_Version_Real = '1.19.56' *-- c_Language = '' && EN, FR, ES, DE c_SimulateError = '' && SIMERR_I0, SIMERR_I1, SIMERR_O1 @@ -1895,6 +1899,7 @@ Define Class c_foxbin2prg As Session Procedure compileFoxProBinary Lparameters tcFileName Local lcType + tcFileName = Evl(tcFileName, This.c_OutputFile) lcType = Upper(Justext(tcFileName)) @@ -2443,12 +2448,16 @@ Define Class c_foxbin2prg As Session Endif *!* /Changed by: Lutz Scheffler 21.02.2021 +*!* Changed by: Lutz Scheffler 04.3.2021 +*!* change date="{^2021-03-04,13:12:00}" +* new value 2, just add one class Case Left( laConfig(m.I), 18 ) == Lower('RedirectClassType:') lcValue = Alltrim( Substr( laConfig(m.I), 19 ) ) - If Inlist( lcValue, '0', '1' ) Then + If Inlist( lcValue, '0', '1', '2' ) Then lo_CFG.n_RedirectClassType = Int( Val( lcValue ) ) .writeLog( C_TAB + Justfname(lcConfigFile) + ' > RedirectClassType: ' + Transform(lcValue) ) Endif +*!* /Changed by: Lutz Scheffler 04.3.2021 Case Left( laConfig(m.I), 24 ) == Lower('RemoveNullCharsFromCode:') lcValue = Alltrim( Substr( laConfig(m.I), 25 ) ) @@ -3244,7 +3253,40 @@ Define Class c_foxbin2prg As Session .evaluateConfiguration( @tcDontShowProgress, @tcDontShowErrors, @tcNoTimestamps, @tcDebug, @tcRecompile, @tcBackupLevels ; , @tcClearUniqueID, @tcOptimizeByFilestamp, @tc_InputFile, @lcInputFile_Type ) -* Redefinir nombre archivo de entrada según el tipo de conversión (IMPORT/EXPORT) +*!* Changed by: Lutz Scheffler 04.3.2021 +*!* change date="{^2021-03-04,13:25:00}" +* for Input file in the form file[.baseclass].class.vc2 (normaly sc2 too, but no support in old code) +* allow to import only the class to file.VCX with n_RedirectClassType = 2 +* n_RedirectClassType = 0 will import all classes of file.VCX (as just handing file.vc2) +* n_RedirectClassType = 1 will import the class to single lib file[.baseclass].class.VCX + Do Case + Case .n_RedirectClassType # 2 + * not handled + Case !Empty(.c_ClassToConvert) + * not otherwise + Case .n_UseClassPerFile = 0 + * not handled + Case Occurs('.',m.tc_InputFile) > .n_UseClassPerFile + * we must have more dots then UseClassPerFile, because there is an extension + + *class + .c_ClassToConvert = Lower( Justext( Juststem( m.tc_InputFile ) ) ) + *remove class + tc_InputFile = Lower( Juststem( Juststem( m.tc_InputFile ) ) + '.' + Justext( m.tc_InputFile ) ) + *remove baseclass + If .n_UseClassPerFile = 0 + *remove baseclass + tc_InputFile = Lower( Juststem( Juststem( m.tc_InputFile ) ) + '.' + Justext( m.tc_InputFile ) ) + Endif + * count anything then -BIN2PRG as import + .c_ClassOperationType = Iif( Atc('-BIN2PRG','-'+tcType) > 0 , 'E', 'I') + + Otherwise + * not handled + Endcase +*!* /Changed by: Lutz Scheffler 04.3.2021 + + * Redefinir nombre archivo de entrada según el tipo de conversión (IMPORT/EXPORT) If .c_ClassOperationType = 'I' * En el caso de importar, debo cambiar la sintaxis de tc_InputFile para poder usar * la conversión existente de clase vc2. @@ -4136,15 +4178,13 @@ Define Class c_foxbin2prg As Session OR Not Empty(.c_ClassToConvert)) Do Case -* SF -* n_RedirectClassType looks like lavacode. At least I see not where it set, except in cfg file, not documented in cfg Files + Case .n_RedirectClassType = 1 Or Not Empty(.c_ClassToConvert) && Redireccionar solo esta clase If Occurs('.', Juststem(.c_InputFile)) = 0 Then lc_BaseFile = .c_InputFile Else lc_BaseFile = Forcepath( Forceext( Juststem( Juststem(.c_InputFile) ), Justext(.c_InputFile)) , Justpath(.c_InputFile) ) Endif -* /SF Case .n_UseClassPerFile = 1 And Inlist(lcExtension,.c_VC2,.c_SC2) If Occurs('.', Juststem(.c_InputFile)) = 0 Then @@ -10796,8 +10836,20 @@ Define Class c_conversor_prg_a_vcx As c_conversor_prg_a_bin If toFoxBin2Prg.n_RedirectClassType = 1 Or Not Empty(toFoxBin2Prg.c_ClassToConvert) && Redireccionar solo esta clase a main llReplaceClass = .T. - If Empty(toFoxBin2Prg.c_ClassToConvert) - toFoxBin2Prg.c_OutputFile = Fullpath( Forceext( lcBaseFilename, 'VCX' ), .c_InputFile) +* - new operations of DBF + If Empty(toFoxBin2Prg.c_ClassToConvert) +*!* Changed by: Lutz Scheffler 04.03.2021 +*!* change date="{^2021-03-04,10:03:00}" +* If inputfile in the form classlib.class.vc2 AND toFoxBin2Prg.n_RedirectClassType = 1 and Execute parameter tcRecompile = 1 +* the change of outputfile might generate an error +* toFoxBin2Prg.c_OutputFile is renamed to classlib.vcx, while this.c_OutputFile is classlib.class.vcx +* this will generate classlib.class.vcx, tries to recompile and toFoxBin2Prg recompiles classlib.vcx +* if classlib.vcx is not existing, it errors out, els it compiles the wrong file. +* So we do not rename if toFoxBin2Prg.n_RedirectClassType = 1 + If toFoxBin2Prg.n_RedirectClassType = 0 + toFoxBin2Prg.c_OutputFile = Fullpath( Forceext( lcBaseFilename, 'VCX' ), .c_InputFile) + Endif +*!* /Changed by: Lutz Scheffler 04.03.2021 Else loClase = toModulo._Clases(1) * Ajusto el nombre interno de la clase al indicado en el nombre del archivo @@ -29354,10 +29406,16 @@ Define Class CL_LANG As Custom <<>>DBF_BinChar_Base64: 1 && 0=For character type fields, if NoCPTrans 0=do not transform, 1=use Base64 transform (default) <<>>DBF_IncludeDeleted: 0 && 0=Do not include deleted records (default), 1=Include deleted records <<>> - <<>>-- CLASS and FORM options + <<>>-- CLASS and FORM options (tx2 is to read as vc2 or sc2, VCX might be SCX) <<>>- Class per file options (UseClassPerFile: 1) <<>>UseClassPerFile: 0 && 0=One library tx2 file, 1=Multiple file.class.tx2 files, 2=Multiple file.baseclass.class.tx2 files <<>>RedirectClassPerFileToMain: 0 && 0=Don't redirect to file.tx2, 1=Redirect to file.tx2 when selecting file.class.tx2 + <<>>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 + <<>> && For the second form: + <<>> && 0 Redirect file[.baseclass].class.tx2 to file.VCX and add / replace all other classes of this library + <<>> && 1 Redirect file[.baseclass].class.tx2 to file[.baseclass].class.VCX and do not touch file.VCX + <<>> && 2 Redirect file[.baseclass].class.tx2 to file.VCX and do not touch other classes of file.VCX <<>>ClassPerFileCheck: 0 && 0=Don't check file.class.tx2 inclusion, 1=Check file.class.tx2 inclusion <<>> <<>>-- Example configuration for SourceSafe compatibility: @@ -29560,6 +29618,12 @@ Define Class CL_LANG As Custom <<>>- Class per file options (UseClassPerFile: 1) <<>>UseClassPerFile: 0 && 0=One library tx2 file, 1=Multiple file.class.tx2 files, 2=Multiple file.baseclass.class.tx2 files <<>>RedirectClassPerFileToMain: 0 && 0=Don't redirect to file.tx2, 1=Redirect to file.tx2 when selecting file.class.tx2 + <<>>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 + <<>> && For the second form: + <<>> && 0 Redirect file[.baseclass].class.tx2 to file.VCX and add / replace all other classes of this library + <<>> && 1 Redirect file[.baseclass].class.tx2 to file[.baseclass].class.VCX and do not touch file.VCX + <<>> && 2 Redirect file[.baseclass].class.tx2 to file.VCX and do not touch other classes of file.VCX <<>>ClassPerFileCheck: 0 && 0=Don't check file.class.tx2 inclusion, 1=Check file.class.tx2 inclusion <<>> <<>>-- Example configuration for SourceSafe compatibility: @@ -29793,6 +29857,12 @@ Define Class CL_LANG As Custom <<>>UseClassPerFile: 0 && 0=Eine Textdatei pro VCX/SCX, 1=Mehrere Dateien .KlassenName.vc2 files, 2=Mehrere Dateien .Basisklasse.KlassenName.vc2 <<>> && Für 1, 2 wird jeweils auch ein Headerdatei .vc2 erzeugt <<>>RedirectClassPerFileToMain: 0 && 0=Keine Umlenkung, 1=Klassen (und Objekte) werden in die VCX/SCX geschrieben wenn eine Datei [.Basisklasse].KlassenName.vc2 gewählt wurde + <<>>RedirectClassType: 0 && Für Textdateien die mit UseClassPerFile>0 in der Form file[.baseclass].class.tx2 erstellt wurden. + <<>> && diese Dateien können als file.tx2::Class::import oder als file[.baseclass].class.tx2 importiert werden. + <<>> && Für die zweite Form gilt: + <<>> && 0 Aus file[.baseclass].class.tx2 wird file.VCX und alle dclassen dieser Bibliothek werden neu gelesen + <<>> && 1 Aus file[.baseclass].class.tx2 wird file[.baseclass].class.VCX, die Bibliothek file.VCX wird ignoriert + <<>> && 2 Aus file[.baseclass].class.tx2 wird file.VCX aber alle anderen Klassen bleiben unverändert <<>>ClassPerFileCheck: 0 && 0=Aus, 1=Teste, ob die Datei einbezogen [.Basisklasse].KlassenName.vc2 wurde <<>> <<>>---------------------------------------------------------------------------------------------------------------- @@ -30006,6 +30076,12 @@ Define Class CL_LANG As Custom <<>>- Class per file options (UseClassPerFile: 1) <<>>UseClassPerFile: 0 && 0=One library tx2 file, 1=Multiple file.class.tx2 files, 2=Multiple file.baseclass.class.tx2 files <<>>RedirectClassPerFileToMain: 0 && 0=Don't redirect to file.tx2, 1=Redirect to file.tx2 when selecting file.class.tx2 + <<>>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 + <<>> && For the second form: + <<>> && 0 Redirect file[.baseclass].class.tx2 to file.VCX and add / replace all other classes of this library + <<>> && 1 Redirect file[.baseclass].class.tx2 to file[.baseclass].class.VCX and do not touch file.VCX + <<>> && 2 Redirect file[.baseclass].class.tx2 to file.VCX and do not touch other classes of file.VCX <<>>ClassPerFileCheck: 0 && 0=Don't check file.class.tx2 inclusion, 1=Check file.class.tx2 inclusion <<>> <<>>-- Example configuration for SourceSafe compatibility: @@ -31465,3 +31541,4 @@ Define Class CL_MEMVAR_RECORD As CL_CUS_BASE Enddefine + \ No newline at end of file