diff --git a/README.md b/README.md index a3356d7..c683318 100644 --- a/README.md +++ b/README.md @@ -1,205 +1,209 @@ -# FoxBin2Prg v1.19.57 -**Binary/Text Converting program for Microsoft Visual FoxPro** - -## Lutz Scheffler -![VFPX Logo](https://vfpx.github.io/images/vfpxbanner_small.gif) - -## Why this fork? -This is a fork of [Fernando D. Bozzo](https://github.com/fdbozzo) [foxbin2prg](https://github.com/fdbozzo/foxbin2prg/). -It's main purpose it's to fix some bugs and add some new functions. It looks like Fernando does not longer maintain FoxBin2Prg, - so, with his permission, I introduce this fork to [VFPX](https://vfpx.github.io/) ![VFPX Picture](./pictures/vfpxpoweredby_alternative.gif). - -I do not maintain the spanish documentation - it would fade. So just check Fernados repo for this information. -A quick run is [introduced](#use-foxbin2prg), more [complex](./Documentacion/github/FoxBin2prg_Run.md#usage-1), and a large [documentation](./Documentacion/github/FoxBin2prg.md) exists too. -Remember yourself to compile the exe first. -For a quick few of the changes made by the fork, see [Changes by the fork](#changes-by-the-fork). - ---- ---- - - -If you like to see Fernandos blog, or value his work: -- Blog: http://fdbozzo.blogspot.com.es/ -- [![DONATE!](http://www.pngall.com/wp-content/uploads/2016/05/PayPal-Donate-Button-PNG-File-180x100.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=fdbozzo%40gmail%2ecom&lc=ES&item_name=FoxBin2Prg&item_number=FoxBin2Prg&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted) - - Thank you for your support! - ---- ---- -If you like to value my work, support the Geeks at https://virtualfoxfest.com/ or www.swfox.net. -I also do not reject invitations to beer, Next autumn in Gilbert. - ---- ---- - -## What is FOXBIN2PRG? -It is a program intended to be used with **SCM tools** (Source Code Managers, like VSS, CVS, SVN) -and *DVCS tools* (Version Control Systems such as Git, Mercurial, Plastic, and others), -or as **standalone** program for **Diff** (viewing differences) and **Merge** operations. -Foxbin2prg can substitute for **SccText/X**, **TwoFox** and others, -and enhance their functionality, generating bidirectional PRG-Style versions of Foxpro binary files that allow recreating the original binary file. - -## Advantages: - -* It generates "PRG" _style_ text files from Foxpro binary files for use in SCM and VCS systems and for visual comparison. - - (it's not really a prg, and can not be compiled, but it reads like one to Foxpro developers.) -* It enables the change of the Text version as easy as modifying a PRG. -* All the program code for any binary file (a form, a report, a class) is in just one text file, to simplify its maintainability. -* You can regenerate the original binaries from the text files, so it is useful as backup -* The extensions are configurable if you create a FOXBIN2PRG.CFG file -* Inheritance of CFG configuration files between directories -* Methods and properties of Text versions are alphabetically sorted for easy comparison -* You can set the "UseClassPerFile" setting to create individual files by class or DBC member. - - (Which violates number three above, but it may be what you want.) -* Takes advantage of the Win32 API using foxbin2prg as an object -* It has compatibility with SccText/X at the parameter level so that it can be used as substitute for SccText with SourceSafe. (Not that we recommend SourceSafe.) -* Productivity: You can create a shortcut in the "SendTo" folder on your user Windows Profile, so you can "send" the selected file (pjx,pj2,etc) to Foxbin2prg.exe and make on-the-fly conversions -* You can modify the TX2 Prg-Style versions of your objects with MODIFY COMMAND (without compile) to see colored syntax, or even use the Document View to navigate the procedures -* Get back your SourceSafe projects (.pjx) from their .pjm file - -The program supports conversions between PJX,SCX,VCX,FRX,LBX,DBC,DBF and MNX files, for which it generates TEXT versions with extension PJ2,SC2,VC2,FR2,LB2,DC2,DB2 and MN2. If you want, the created text file extensions can be reconfigured to be compatibilize with SourceSafe. - -## Examples -### Redefine extensions of _Text_ -Here is an example of a FOXBIN2PRG.CFG configuration file if you need to change extensions for using it with a specific VSS (SourceSafe) -``` -extension: SC2=SCA -extension: VC2=VCA -extension: PJ2=PJA -extension: MN2=MNA -extension: FR2=FRA -extension: LB2=LBA -extension: DB2=DBA -extension: DC2=DCA -``` - -### Use FoxBin2Prg -``` -DO FOXBIN2PRG.PRG WITH "\archivo.scx" ==> Generates the TEXT version sc2 extension -DO FOXBIN2PRG.PRG WITH "\archivo.sc2" ==> Regenerates the binary version with scx extension - -DO FOXBIN2PRG.PRG WITH "-c","template.cfg" ==> Generates a template for FoxBin2Prg.cfg config file with newest settings -DO FOXBIN2PRG.PRG WITH "-t","template.dbf.cfg" ==> Generates a template for table.dbf.cfg per table config file with newest settings -``` - -### Use with MS Windows SendTo -You can create up to three different shortcuts pointing to FoxBin2Prg.exe and in your "SendTo" folder in your Windows profile. This allows you to "send" a selected file (pjx,pj2,etc) to the selected option, and make on-the-fly conversions. (Make sure you have the option for seeing known file extensions turned on!): - -#### Process directories or individual files to _Text_ -- Name: - `FoxBin2Prg - Binary2Text.lnk` -- Right-click/Properties/destination_ - `\foxbin2prg.exe "BIN2PRG-SHOWMSG"` -#### Process directories or individual files to _Binary_ -- Name: - `FoxBin2Prg - Text2Binary.lnk` -- Right-click/Properties/destination_ - `\foxbin2prg.exe "PRG2BIN-SHOWMSG"` -#### Process individual files or directories asking what to convert -- Name: - `FoxBin2Prg.lnk` -- Right-click/Properties/destination_ - `\foxbin2prg.exe "INTERACTIVE-SHOWMSG"` - -##### How to use the links -Select a file, right-click, SendTo -> FoxBin2Prg - -## LOCALIZATION: -Is automatic starting at v1.19.38 (Languages: EN,ES,FR,DE) - - -## FINAL NOTE: -This program is Open Source and "libre", and I don't make any guaranties that it fulfills your expectations or that it will be free of bugs. -I will try to fix bugs if my obligations let me do it. - -## Project info and updates: - -Fernando D. Bozzo's repository at Github: https://github.com/fdbozzo/foxbin2prg -Lutz Scheffler's repository at Github: https://github.com/lscheffler/foxbin2prg - -## LICENCE: -This work is licensed under the Creative Commons Attribution 4.0 International License. -To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/. - ---- ---- -## Changes by this fork (1.19.55) -To get the new settings in config file, use the new create-a-template function: - -``` -DO FOXBIN2PRG.PRG WITH "-c","template.cfg" ==> Generates a template for FoxBin2Prg.cfg config file with newest settings -DO FOXBIN2PRG.PRG WITH "-t","template.dbf.cfg" ==> Generates a template for table.dbf.cfg per table config file with newest settings -``` - -### Exe file -Removed exe file. Just a bloat of teh repo, any disciple of the Fox know how to create, if in need. -The prg works anyway. - -### Split of container files -VCX, SCX and DBC are container that hold different items. There is was a single option to split them. -The split of DBC the same way like VCX/SCX might not be the best choice under all circumstances. -New option _OldFilesPerDBC_ is set 1, _UseFilesPerDBC_, _RedirectFilePerDBCToMain_ and _ItemPerDBCCheck_ might be used to set the handling of the DBC. -Note that those options will be ignored, if _OldFilesPerDBC_ is 0 (default). -**Check that changes will be reflected on running projects.** -See [Internals](./Documentacion/github/FoxBin2prg_Internals.md#configuration-file). - -### Tanscoding of table fields with NoCPTrans -The function _DBF_BinChar_Base64: 0_ must be handled with care too. -Tables must converted to _Text_ according. **It's not recommended for running projects. Handle with extra care otherwise.** - -### Inclusion of deleted records -Sometimes information left in deleted (table) records is still valuable information. -The new option _DBF_IncludeDeleted_ allows to keep those records throug conversion. -The data added by _DBF_IncludeDeleted: 1_ will be ignored by old versions generating _Binary_ files. - -#### Recomendation -It's a good idea to have the _FoxBin2Prg.cfg_ per projekt and and source control, -old commits / versions would have the old config. -So the settings would fit the data and FoxBin2Prg could generate according to it. - -### Fixes -Fixes only are in the fork branch of this repo. - -| Details | -| - | -| Added MEM and FKY options to config template and internal documentation | -| Conversion prg -> vcx, files per class could create one class multiple times | -| Processing directory, flush log file after loop instead of file | -| Conversion prg -> dbf, fields with .NULL. value are incorectly recreated | -| 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 | -| Bug on RedirectClassType = 2 mixed up PATH | - -### Features - -| Details | -| - | -| [Documentation](./Documentacion/github/FoxBin2prg.md) reworked. | -| German translation improved | -| Info screen-doc improved | -| Inserted option DBF_IncludeDeleted to allow including deleted records of DBF | -| Inserted option DBF_BinChar_Base64 to allow processing of NoCPTrans fields in non base64 way | -| Inserted option OldFilesPerDBC to control split of DBC, the options below are controled by this | -| Inserted option UseFilesPerDBC to split DBC processing from vcx / scx | -| 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 | - - ---- ---- -# Folder information -Project to generate text representations of VFP binary sources for source control - -## ./ -This folder containes the files necessary to run FoxBin2Prg.prg or to create the FoxBin2Prg.exe - -For usage see [documentation](./Documentacion/github/FoxBin2prg.md) - ----- +# FoxBin2Prg v1.19.57 +**Binary/Text Converting program for Microsoft Visual FoxPro** + +## Lutz Scheffler +![VFPX Logo](https://vfpx.github.io/images/vfpxbanner_small.gif) + +## Why this fork? +This is a fork of [Fernando D. Bozzo](https://github.com/fdbozzo) [foxbin2prg](https://github.com/fdbozzo/foxbin2prg/). +It's main purpose it's to fix some bugs and add some new functions. It looks like Fernando does not longer maintain FoxBin2Prg, + so, with his permission, I introduce this fork to [VFPX](https://vfpx.github.io/) ![VFPX Picture](./pictures/vfpxpoweredby_alternative.gif). + +I do not maintain the spanish documentation - it would fade. So just check Fernados repo for this information. +A quick run is [introduced](#use-foxbin2prg), more [complex](./Documentacion/github/FoxBin2prg_Run.md#usage-1), and a large [documentation](./Documentacion/github/FoxBin2prg.md) exists too. +Remember yourself to compile the exe first. +For a quick few of the changes made by the fork, see [Changes by the fork](#changes-by-the-fork). + +--- +--- + + +If you like to see Fernandos blog, or value his work: +- Blog: http://fdbozzo.blogspot.com.es/ +- [![DONATE!](http://www.pngall.com/wp-content/uploads/2016/05/PayPal-Donate-Button-PNG-File-180x100.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=fdbozzo%40gmail%2ecom&lc=ES&item_name=FoxBin2Prg&item_number=FoxBin2Prg&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted) + + Thank you for your support! + +--- +--- +If you like to value my work, support the Geeks at https://virtualfoxfest.com/ or www.swfox.net. +I also do not reject invitations to beer, Next autumn in Gilbert. + +--- +--- + +## What is FOXBIN2PRG? +It is a program intended to be used with **SCM tools** (Source Code Managers, like VSS, CVS, SVN) +and *DVCS tools* (Version Control Systems such as Git, Mercurial, Plastic, and others), +or as **standalone** program for **Diff** (viewing differences) and **Merge** operations. +Foxbin2prg can substitute for **SccText/X**, **TwoFox** and others, +and enhance their functionality, generating bidirectional PRG-Style versions of Foxpro binary files that allow recreating the original binary file. + +## Advantages: + +* It generates "PRG" _style_ text files from Foxpro binary files for use in SCM and VCS systems and for visual comparison. + + (it's not really a prg, and can not be compiled, but it reads like one to Foxpro developers.) +* It enables the change of the Text version as easy as modifying a PRG. +* All the program code for any binary file (a form, a report, a class) is in just one text file, to simplify its maintainability. +* You can regenerate the original binaries from the text files, so it is useful as backup +* The extensions are configurable if you create a FOXBIN2PRG.CFG file +* Inheritance of CFG configuration files between directories +* Methods and properties of Text versions are alphabetically sorted for easy comparison +* You can set the "UseClassPerFile" setting to create individual files by class or DBC member. + + (Which violates number three above, but it may be what you want.) +* Takes advantage of the Win32 API using foxbin2prg as an object +* It has compatibility with SccText/X at the parameter level so that it can be used as substitute for SccText with SourceSafe. (Not that we recommend SourceSafe.) +* Productivity: You can create a shortcut in the "SendTo" folder on your user Windows Profile, so you can "send" the selected file (pjx,pj2,etc) to Foxbin2prg.exe and make on-the-fly conversions +* You can modify the TX2 Prg-Style versions of your objects with MODIFY COMMAND (without compile) to see colored syntax, or even use the Document View to navigate the procedures +* Get back your SourceSafe projects (.pjx) from their .pjm file + +The program supports conversions between PJX,SCX,VCX,FRX,LBX,DBC,DBF and MNX files, for which it generates TEXT versions with extension PJ2,SC2,VC2,FR2,LB2,DC2,DB2 and MN2. If you want, the created text file extensions can be reconfigured to be compatibilize with SourceSafe. + +## Examples +### Redefine extensions of _Text_ +Here is an example of a FOXBIN2PRG.CFG configuration file if you need to change extensions for using it with a specific VSS (SourceSafe) +``` +extension: SC2=SCA +extension: VC2=VCA +extension: PJ2=PJA +extension: MN2=MNA +extension: FR2=FRA +extension: LB2=LBA +extension: DB2=DBA +extension: DC2=DCA +``` + +### Use FoxBin2Prg +``` +DO FOXBIN2PRG.PRG WITH "\archivo.scx" ==> Generates the TEXT version sc2 extension +DO FOXBIN2PRG.PRG WITH "\archivo.sc2" ==> Regenerates the binary version with scx extension + +DO FOXBIN2PRG.PRG WITH "-c","template.cfg" ==> Generates a template for FoxBin2Prg.cfg config file with newest settings +DO FOXBIN2PRG.PRG WITH "-t","template.dbf.cfg" ==> Generates a template for table.dbf.cfg per table config file with newest settings +``` + +### Use with MS Windows SendTo +You can create up to three different shortcuts pointing to FoxBin2Prg.exe and in your "SendTo" folder in your Windows profile. This allows you to "send" a selected file (pjx,pj2,etc) to the selected option, and make on-the-fly conversions. (Make sure you have the option for seeing known file extensions turned on!): + +#### Process directories or individual files to _Text_ +- Name: + `FoxBin2Prg - Binary2Text.lnk` +- Right-click/Properties/destination_ + `\foxbin2prg.exe "BIN2PRG-SHOWMSG"` +#### Process directories or individual files to _Binary_ +- Name: + `FoxBin2Prg - Text2Binary.lnk` +- Right-click/Properties/destination_ + `\foxbin2prg.exe "PRG2BIN-SHOWMSG"` +#### Process individual files or directories asking what to convert +- Name: + `FoxBin2Prg.lnk` +- Right-click/Properties/destination_ + `\foxbin2prg.exe "INTERACTIVE-SHOWMSG"` + +##### How to use the links +Select a file, right-click, SendTo -> FoxBin2Prg + +## LOCALIZATION: +Is automatic starting at v1.19.38 (Languages: EN,ES,FR,DE) + + +## FINAL NOTE: +This program is Open Source and "libre", and I don't make any guaranties that it fulfills your expectations or that it will be free of bugs. +I will try to fix bugs if my obligations let me do it. + +## Project info and updates: + +Fernando D. Bozzo's repository at Github: https://github.com/fdbozzo/foxbin2prg +Lutz Scheffler's repository at Github: https://github.com/lscheffler/foxbin2prg + +## LICENCE: +This work is licensed under the Creative Commons Attribution 4.0 International License. +To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/. + +--- +--- +## Changes in 1.19.58 +* Added support for writing to a different folder than the source code using a new tcOutputFolder parameter +* Added a configuration item: HomeDir, which determines if HomeDir is saved in PJ2 files (the default is 1 for Yes) + +## Changes by this fork (1.19.55) +To get the new settings in config file, use the new create-a-template function: + +``` +DO FOXBIN2PRG.PRG WITH "-c","template.cfg" ==> Generates a template for FoxBin2Prg.cfg config file with newest settings +DO FOXBIN2PRG.PRG WITH "-t","template.dbf.cfg" ==> Generates a template for table.dbf.cfg per table config file with newest settings +``` + +### Exe file +Removed exe file. Just a bloat of teh repo, any disciple of the Fox know how to create, if in need. +The prg works anyway. + +### Split of container files +VCX, SCX and DBC are container that hold different items. There is was a single option to split them. +The split of DBC the same way like VCX/SCX might not be the best choice under all circumstances. +New option _OldFilesPerDBC_ is set 1, _UseFilesPerDBC_, _RedirectFilePerDBCToMain_ and _ItemPerDBCCheck_ might be used to set the handling of the DBC. +Note that those options will be ignored, if _OldFilesPerDBC_ is 0 (default). +**Check that changes will be reflected on running projects.** +See [Internals](./Documentacion/github/FoxBin2prg_Internals.md#configuration-file). + +### Tanscoding of table fields with NoCPTrans +The function _DBF_BinChar_Base64: 0_ must be handled with care too. +Tables must converted to _Text_ according. **It's not recommended for running projects. Handle with extra care otherwise.** + +### Inclusion of deleted records +Sometimes information left in deleted (table) records is still valuable information. +The new option _DBF_IncludeDeleted_ allows to keep those records throug conversion. +The data added by _DBF_IncludeDeleted: 1_ will be ignored by old versions generating _Binary_ files. + +#### Recomendation +It's a good idea to have the _FoxBin2Prg.cfg_ per projekt and and source control, +old commits / versions would have the old config. +So the settings would fit the data and FoxBin2Prg could generate according to it. + +### Fixes +Fixes only are in the fork branch of this repo. + +| Details | +| - | +| Added MEM and FKY options to config template and internal documentation | +| Conversion prg -> vcx, files per class could create one class multiple times | +| Processing directory, flush log file after loop instead of file | +| Conversion prg -> dbf, fields with .NULL. value are incorectly recreated | +| 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 | +| Bug on RedirectClassType = 2 mixed up PATH | + +### Features + +| Details | +| - | +| [Documentation](./Documentacion/github/FoxBin2prg.md) reworked. | +| German translation improved | +| Info screen-doc improved | +| Inserted option DBF_IncludeDeleted to allow including deleted records of DBF | +| Inserted option DBF_BinChar_Base64 to allow processing of NoCPTrans fields in non base64 way | +| Inserted option OldFilesPerDBC to control split of DBC, the options below are controled by this | +| Inserted option UseFilesPerDBC to split DBC processing from vcx / scx | +| 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 | + + +--- +--- +# Folder information +Project to generate text representations of VFP binary sources for source control + +## ./ +This folder containes the files necessary to run FoxBin2Prg.prg or to create the FoxBin2Prg.exe + +For usage see [documentation](./Documentacion/github/FoxBin2prg.md) + +---- Last changed: _2021/03/05_ ![Picture](./pictures/vfpxpoweredby_alternative.gif) \ No newline at end of file diff --git a/ThorUpdater/FoxBin2Prg.zip b/ThorUpdater/FoxBin2Prg.zip index 1c73e69..1b934ca 100644 Binary files a/ThorUpdater/FoxBin2Prg.zip and b/ThorUpdater/FoxBin2Prg.zip differ diff --git a/ThorUpdater/FoxBin2PrgVersion.txt b/ThorUpdater/FoxBin2PrgVersion.txt index 9236fe9..6f7889a 100644 --- a/ThorUpdater/FoxBin2PrgVersion.txt +++ b/ThorUpdater/FoxBin2PrgVersion.txt @@ -1,11 +1,7 @@ lparameters toUpdateObject -local ldDate, ; - lnJulian, ; - lcJulian -ldDate = date(2018,7,31) -lnJulian = val(sys(11, ldDate)) - val(sys(11, {^2000-01-01})) -lcJulian = padl(transform(lnJulian), 4, '0') -toUpdateObject.AvailableVersion = 'FoxBin2Prg-1.19.51.4' + lcJulian + ; +local ldDate +ldDate = date() +toUpdateObject.AvailableVersion = 'FoxBin2Prg-1.19.58' + ; '-update-' + dtoc(ldDate, 1) return toUpdateObject diff --git a/ThorUpdater/Project.txt b/ThorUpdater/Project.txt index d36b413..2fb0f8f 100644 --- a/ThorUpdater/Project.txt +++ b/ThorUpdater/Project.txt @@ -1,5 +1,5 @@ appName = FoxBin2Prg appID = FoxBin2Prg -majorVersion = 1.19.51.5 +majorVersion = 1.19.58 excludeFiles = *.bak,*.bat,*.fxp,*.tbk,*.tmp,*.dat,*.log,*.cvp,README.md,.gitignore,*.zip*,*.7z*,*- copia.*,*.private.*,test_*.*,xx*.*,*.lnk,vfp_init.*,tmp*.*,*.err, *.conflict.*, *.private.* excludeFolders = *.plastic*,*ThorUpdater*,*Documentacion*,*foxunit*,*foxunit_*,*pruebas varias*,*versiones*,*datos_test* diff --git a/foxbin2prg.cfg.txt b/foxbin2prg.cfg.txt index d9f859d..969de9f 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.21.2 +*Version: v1.19.58 *################################################################################################################ *extension: tx2=newext && Specify extensions to use. Default FoxBin2Prg extensions ends in '2' (see at the bottom) @@ -18,6 +18,7 @@ *Language: (auto) && Language of shown messages and LOGs. EN=English, FR=French, ES=Español, DE=German, Not defined = AUTOMATIC [DEFAULT] *ExcludeDBFAutoincNextval: 0 && [0=Do not exclude this value from db2], 1=Exclude this value from db2 *PRG_Compat_Level: 0 && [0=Legacy], 1=Use HELPSTRING as Class Procedure comment +*HomeDir: 1 && 0 = don't save HomeDir in PJ2, [1 = save HomeDir in PJ2] *-- Convertion options: *PJX_Conversion_Support: 2 && 0=No support, 1=Generate TXT only (Diff), 2=Generate TXT and BIN (Merge) diff --git a/foxbin2prg.exe b/foxbin2prg.exe index 22a9cd8..8f1e949 100644 Binary files a/foxbin2prg.exe and b/foxbin2prg.exe differ diff --git a/foxbin2prg.pjt b/foxbin2prg.pjt index ced047d..6d7e128 100644 Binary files a/foxbin2prg.pjt and b/foxbin2prg.pjt differ diff --git a/foxbin2prg.pjx b/foxbin2prg.pjx index e01a0eb..849e9dc 100644 Binary files a/foxbin2prg.pjx and b/foxbin2prg.pjx differ diff --git a/foxbin2prg.prg b/foxbin2prg.prg index 9c9ef91..3624e7e 100644 --- a/foxbin2prg.prg +++ b/foxbin2prg.prg @@ -247,8 +247,8 @@ * fails silent if classlib.vcx exists (compiles wrong lib), with message if not. * 04/03/2021 LScheffler v1.19.56 Enhancement: New value for RedirectClassType = 2, just process the single class of classlib.class.vc2 * 04/03/2021 LScheffler v1.19.57 Bug Fix: For RedirectClassType = 2, Path was set wrong - - +* 2021-03-04 DH v1.19.58 Enhancement: added support for writing to a different folder than the source code (Doug Hennig) +* 2021-03-04 DH v1.19.58 Enhancement: added configuration item: HomeDir, which determines if HomeDir is saved in PJ2 files (Doug Hennig) * * *--------------------------------------------------------------------------------------------------- @@ -415,11 +415,14 @@ * NOTA: Si en vez de '1' se indica un Path (p.ej, el del proyecto, se usará como base para recompilar * tcNoTimestamps (v? IN ) Indica si se debe anular el timestamp ('1') o no ('0' ó vacío) * tcCFG_File (v? IN ) Indica si se debe usar un archivo de configuración distinto al predeterminado +*** DH 2021-03-04: added tcOutputFolder parameter +* tcOutputFolder (v? IN ) The output folder to write to (optional: if it isn't specified, the same folder as the source is used) *--------------------------------------------------------------------------------------------------- * Ej: DO FOXBIN2PRG.PRG WITH "C:\DESA\INTEGRACION\LIBRERIA.VCX" *--------------------------------------------------------------------------------------------------- +*** DH 2021-03-04: added tcOutputFolder parameter Lparameters tc_InputFile, tcType, tcTextName, tlGenText, tcDontShowErrors, tcDebug, tcDontShowProgress, tcOriginalFileName ; - , tcRecompile, tcNoTimestamps, tcCFG_File + , tcRecompile, tcNoTimestamps, tcCFG_File, tcOutputFolder *-- NO modificar! / Do NOT change! #Define C_CMT_I '*--' @@ -659,20 +662,25 @@ Endif *!* /Changed by: Lutz Scheffler 15.2.2021 Try - loEx = Null - loCnv = Createobject("c_foxbin2prg") - lnResp = loCnv.execute( tc_InputFile, tcType, tcTextName, tlGenText, tcDontShowErrors, tcDebug ; - , tcDontShowProgress, Null, @loEx, .F., tcOriginalFileName, tcRecompile, tcNoTimestamps ; - , .F., .F., .F., tcCFG_File ) - Catch To loEx + loEx = Null + loCnv = Createobject("c_foxbin2prg") +*** DH 2021-03-04: handle tcOutputFolder + if not empty(tcOutputFolder) + loCnv.cOutputFolder = tcOutputFolder + endif not empty(tcOutputFolder) +*** DH 2021-03-04: end of new code + lnResp = loCnv.execute( tc_InputFile, tcType, tcTextName, tlGenText, tcDontShowErrors, tcDebug ; + , tcDontShowProgress, Null, @loEx, .F., tcOriginalFileName, tcRecompile, tcNoTimestamps ; + , .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) @@ -850,7 +858,7 @@ Define Class c_foxbin2prg As Session Protected n_CFG_Actual, l_Main_CFG_Loaded, o_Configuration, l_CFG_CachedAccess *-- n_FB2PRG_Version = 1.19 - c_FB2PRG_Version_Real = '1.19.57' + c_FB2PRG_Version_Real = '1.19.58' *-- c_Language = '' && EN, FR, ES, DE c_SimulateError = '' && SIMERR_I0, SIMERR_I1, SIMERR_O1 @@ -959,7 +967,9 @@ Define Class c_foxbin2prg As Session DBC_Conversion_Support = 2 DBF_Conversion_Included = '' 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 Procedure Init Lparameters tcCFG_File, tcCancelWithEscKey @@ -1711,6 +1721,17 @@ Define Class c_foxbin2prg As Session Endproc +*** DH 2021-03-04: added n_HomeDir_Access + PROCEDURE n_HomeDir_ACCESS + IF THIS.n_CFG_Actual = 0 OR ISNULL( THIS.o_Configuration( THIS.n_CFG_Actual ) ) + RETURN THIS.n_HomeDir + ELSE + RETURN NVL( THIS.o_Configuration( THIS.n_CFG_Actual ).n_HomeDir, THIS.n_HomeDir ) + ENDIF + ENDPROC +*** DH 2021-03-04: end of new code + + Procedure changeFileAttribute * Using Win32 Functions in Visual FoxPro * example=103 @@ -2590,6 +2611,15 @@ Define Class c_foxbin2prg As Session lo_CFG.n_PRG_Compat_Level = Int( Val( lcValue ) ) .writeLog( C_TAB + Justfname(lcConfigFile) + ' > PRG_Compat_Level: ' + Transform(lo_CFG.n_PRG_Compat_Level) ) +*** 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 @@ -4461,6 +4491,9 @@ Define Class c_foxbin2prg As Session Endcase +*** DH 2021-03-04: handle cOutputFolder + loConversor.cOutputFolder = This.cOutputFolder + *-- Optimización: Comparación de los timestamps de InputFile y OutputFile para saber *-- si el OutputFile se debe regenerar o no. lnFileCount = Adir( laFiles, Forceext( .c_InputFile, '*' ), '', 1 ) @@ -6529,6 +6562,8 @@ Define Class c_conversor_base As Custom c_ClaseActual = '' oFSO = Null n_Methods_LineNo = 0 && Número de línea del error dentro de "Methods" +*** DH 2021-03-04: added cOutputFolder property + cOutputFolder = '' @@ -15931,6 +15966,12 @@ Define Class c_conversor_bin_a_prg As c_conversor_base Local lcExpanded, llFileExists, lnBytes, lcOutputFile, laDirFile(1,5) ; , loLang As CL_LANG Of 'FOXBIN2PRG.PRG' +*** DH 2021-03-04: handle cOutputFolder + if not empty(This.cOutputFolder) + tcOutputFile = forcepath(tcOutputFile, This.cOutputFolder) + endif not empty(This.cOutputFolder) +*** DH 2021-03-04: end of new code + lcExpanded = Iif( '.' $ Juststem(tcOutputFile), 'X1', 'X0' ) *-- addProcessedFile( tcFile, tcInOutType, tcProcessed, tcHasErrors, tcSupported, tcExpanded ) @@ -16849,9 +16890,19 @@ Define Class c_conversor_pjx_a_prg As c_conversor_bin_a_prg *-- Generación del proyecto +*** DH 2021-03-04: only output HomeDir if we're supposed to + if toFoxBin2Prg.n_HomeDir = 1 TEXT TO C_FB2PRG_CODE ADDITIVE TEXTMERGE NOSHOW FLAGS 1+2 PRETEXT 1+2 - <> - <<>>*<.HomeDir = <> /> + <> + <<>>*<.HomeDir = <> /> + ENDTEXT + else + TEXT TO C_FB2PRG_CODE ADDITIVE TEXTMERGE NOSHOW FLAGS 1+2 PRETEXT 1+2 + <> + ENDTEXT + endif toFoxBin2Prg.n_HomeDir = 1 +*** DH 2021-03-04: end of updated code + TEXT TO C_FB2PRG_CODE ADDITIVE TEXTMERGE NOSHOW FLAGS 1+2 PRETEXT 1+2 <<>> FOR EACH loProject IN _VFP.Projects FOXOBJECT <<>> loProject.Close() @@ -17409,9 +17460,19 @@ Define Class c_conversor_pjm_a_prg As c_conversor_bin_a_prg With This As c_conversor_pjm_a_prg Of 'FOXBIN2PRG.PRG' *-- Generación del proyecto +*** DH 2021-03-04: only output HomeDir if we're supposed to + if toFoxBin2Prg.n_HomeDir = 1 TEXT TO C_FB2PRG_CODE ADDITIVE TEXTMERGE NOSHOW FLAGS 1+2 PRETEXT 1+2 - <> - <<>>*<.HomeDir = <> /> + <> + <<>>*<.HomeDir = <> /> + ENDTEXT + else + TEXT TO C_FB2PRG_CODE ADDITIVE TEXTMERGE NOSHOW FLAGS 1+2 PRETEXT 1+2 + <> + ENDTEXT + endif toFoxBin2Prg.n_HomeDir = 1 +*** DH 2021-03-04: end of updated code + TEXT TO C_FB2PRG_CODE ADDITIVE TEXTMERGE NOSHOW FLAGS 1+2 PRETEXT 1+2 <<>> FOR EACH loProject IN _VFP.Projects FOXOBJECT <<>> loProject.Close() @@ -29089,6 +29150,8 @@ Define Class CL_CFG As Custom DBC_Conversion_Support = Null c_BackgroundImage = Null n_PRG_Compat_Level = Null +*** DH 2021-03-04: added n_HomeDir property + n_HomeDir = NULL Procedure CopyFrom @@ -29152,6 +29215,8 @@ Define Class CL_CFG As Custom .DBC_Conversion_Support = toParentCFG.DBC_Conversion_Support .c_BackgroundImage = toParentCFG.c_BackgroundImage .n_PRG_Compat_Level = toParentCFG.n_PRG_Compat_Level +*** DH 2021-03-04: handle n_HomeDir + .n_HomeDir = toParentCFG.n_HomeDir Endwith Endproc @@ -29322,7 +29387,6 @@ Define Class CL_LANG As Custom .C_FILENAME_LOC = "Fichier" .C_FOXBIN2PRG_ERROR_CAPTION_LOC = "ERREUR" .C_FOXBIN2PRG_SYNTAX_INFO_LOC = "SYNTAX AND PARAMETERS INFO" - TEXT TO .C_FOXBIN2PRG_SYNTAX_INFO_EXAMPLE_LOC TEXTMERGE NOSHOW FLAGS 1 PRETEXT 1+2 <<>>FoxBin2Prg Home Page and download: https://github.com/fdbozzo/foxbin2prg/wiki - Fernando D. Bozzo (2013.11.25) <<>> @@ -29355,6 +29419,7 @@ Define Class CL_LANG As Custom <<>> <<>> ENDTEXT +*** DH 2021-03-04: added HomeDir to text TEXT TO .C_FOXBIN2PRG_SYNTAX_INFO_EXAMPLE_LOC_cfg TEXTMERGE NOSHOW FLAGS 1 PRETEXT 1+2 <<>>################################################################################################################ <<>>FOXBIN2PRG.CFG configuration options: (If no values given, these are the DEFAULTS) @@ -29376,6 +29441,7 @@ Define Class CL_LANG As Custom <<>>Language: (auto) && Language of shown messages and LOGs. EN=English, FR=French, ES=Español, DE=German, Not defined = AUTOMATIC [DEFAULT] <<>>ExcludeDBFAutoincNextval: 0 && [0=Do not exclude this value from db2], 1=Exclude this value from db2 <<>>PRG_Compat_Level: 0 && [0=Legacy], 1=Use HELPSTRING as Class Procedure comment + <<>>HomeDir: 1 && 0 = don't save HomeDir in PJ2, [1 = save HomeDir in PJ2] <<>> <<>>-- Convertion options: <<>>PJX_Conversion_Support: 2 && 0=No support, 1=Generate TXT only (Diff), 2=Generate TXT and BIN (Merge) @@ -29564,6 +29630,7 @@ Define Class CL_LANG As Custom <<>> <<>> ENDTEXT +*** DH 2021-03-04: added HomeDir to text TEXT TO .C_FOXBIN2PRG_SYNTAX_INFO_EXAMPLE_LOC_cfg TEXTMERGE NOSHOW FLAGS 1 PRETEXT 1+2 <<>>################################################################################################################ <<>>FOXBIN2PRG.CFG configuration options: (If no values given, these are the DEFAULTS) @@ -29585,6 +29652,7 @@ Define Class CL_LANG As Custom <<>>Language: (auto) && Language of shown messages and LOGs. EN=English, FR=French, ES=Español, DE=German, Not defined = AUTOMATIC [DEFAULT] <<>>ExcludeDBFAutoincNextval: 0 && [0=Do not exclude this value from db2], 1=Exclude this value from db2 <<>>PRG_Compat_Level: 0 && [0=Legacy], 1=Use HELPSTRING as Class Procedure comment + <<>>HomeDir: 1 && 0 = don't save HomeDir in PJ2, [1 = save HomeDir in PJ2] <<>> <<>>-- Convertion options: <<>>PJX_Conversion_Support: 2 && 0=No support, 1=Generate TXT only (Diff), 2=Generate TXT and BIN (Merge) @@ -29774,6 +29842,7 @@ Define Class CL_LANG As Custom <<>>cCFG_File: Legt eine alternative Configurationsdate (CFG) fest, die statt der im foxbin2prg Verzeichnis genutzt werden soll. (Anm. des Übersetzers: Keine Angabe über Vererbung in der Verzeichnishierarchie) <<>> ENDTEXT +*** DH 2021-03-04: added HomeDir to text TEXT TO .C_FOXBIN2PRG_SYNTAX_INFO_EXAMPLE_LOC_cfg TEXTMERGE NOSHOW FLAGS 1 PRETEXT 1+2 <<>>################################################################################################################ <<>>FOXBIN2PRG.CFG Konfigurations Optionen: (Wird die Option nicht aufgeführt, ist der Wert im Beispiel der Default) @@ -29805,6 +29874,7 @@ Define Class CL_LANG As Custom <<>>Language: (auto) && Sprache für Anzeigen und Logs. EN=English, FR=Français, ES=Español, DE=Deutsch, Nicht definiert = Automatisch [DEFAULT] <<>>ExcludeDBFAutoincNextval: 0 && 0=Aus, 1=Entferne diesen Wert aus der Textdate der Datenbank (db2) <<>>PRG_Compat_Level: 0 && [0=Legacy], 1=Nutze HELPSTRING als Class Procedure Kommentar + <<>>HomeDir: 1 && 0 = don't save HomeDir in PJ2, [1 = save HomeDir in PJ2] <<>> <<>>---------------------------------------------------------------------------------------------------------------- <<>>-- Konvertierungs Optionen: @@ -30022,6 +30092,7 @@ Define Class CL_LANG As Custom <<>> <<>> ENDTEXT +*** DH 2021-03-04: added HomeDir to text TEXT TO .C_FOXBIN2PRG_SYNTAX_INFO_EXAMPLE_LOC_cfg TEXTMERGE NOSHOW FLAGS 1 PRETEXT 1+2 <<>>################################################################################################################ <<>>FOXBIN2PRG.CFG configuration options: (If no values given, these are the DEFAULTS) @@ -30043,6 +30114,7 @@ Define Class CL_LANG As Custom <<>>Language: (auto) && Language of shown messages and LOGs. EN=English, FR=French, ES=Español, DE=German, Not defined = AUTOMATIC [DEFAULT] <<>>ExcludeDBFAutoincNextval: 0 && [0=Do not exclude this value from db2], 1=Exclude this value from db2 <<>>PRG_Compat_Level: 0 && [0=Legacy], 1=Use HELPSTRING as Class Procedure comment + <<>>HomeDir: 1 && 0 = don't save HomeDir in PJ2, [1 = save HomeDir in PJ2] <<>> <<>>-- Convertion options: <<>>PJX_Conversion_Support: 2 && 0=No support, 1=Generate TXT only (Diff), 2=Generate TXT and BIN (Merge)