From 3405c007cdef8e8287a6c229f3e6786d1c0d9f20 Mon Sep 17 00:00:00 2001 From: Lutz Date: Mon, 22 Feb 2021 11:26:15 +0100 Subject: [PATCH] Better doku --- Documentacion/github/FoxBin2Prg_Run.md | 122 +++++++++++++++++++++++++ Documentacion/github/FoxBin2prg.md | 2 +- foxbin2prg.prg | 38 ++++---- 3 files changed, 144 insertions(+), 18 deletions(-) diff --git a/Documentacion/github/FoxBin2Prg_Run.md b/Documentacion/github/FoxBin2Prg_Run.md index e69de29..4b77da5 100644 --- a/Documentacion/github/FoxBin2Prg_Run.md +++ b/Documentacion/github/FoxBin2Prg_Run.md @@ -0,0 +1,122 @@ +# Purpose of this document +This document is an attempt to recreate the original documentation of FoxBin2Prg out of CodePlex. +I found the documentation on [foxbin2prg](https://github.com/fdbozzo/foxbin2prg/blob/master/README.md) a bit brief. For a short what and why, see there. + +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. + +---- +![VFPX logo](https://vfpx.github.io/images/vfpxbanner_small.gif) +This project is part of VFPX. + +---- +# FoxBin2Prg - Usage in command line style +FoxBin2Prg might be used as an EXE either from Windows or VFP, or as as prg from inside VFP. +Since the EXE is basically the prg packed with some controling files, the way to call it ist mostly similar. +The knowledge of differences in calling, DO .. WITH syntax separating parameters with "," and the DOS way off calling will be assumed. +Do to the similarity of the call, the prg version takes all parameters as strings too. +## Main differences +### EXE +The exe contains the mos controling structures and the program itself. +Alongside the _FoxBin2Prg.exe_ must be _FileName_Caps.exe_ . +It is recomended to have a general _FoxBin2Prg.cfg_ configuration file, but it will run without. +### PRG +The prg is just the program and needs to find the controling structures. In particular: +- _FileName_Caps.exe_ +- _Props*.txt_ +- _FileName_Caps.exe_ +- _FoxBin2Prg.cfg_ is recomended +#### Note +All mentioned files need to be in the same folder. You can't use just the PRG without the rest of the mentioned files. +## Parameters +`FoxBin2Prg.EXE ...` +could be used from VFP command line as +`DO FoxBin2Prg.EXE WITH ...` +or +`DO FoxBin2Prg.prg WITH ...` +or via _RUN_ or more sophisticated ways. +Remember that using the prg style, parameters must be wrapped in string delimiters. +#### Note +Do to the compatibility with VSS the usage of _cInputFile_ and _cType_ is odd. +#### Important note: +
When you process a directory, it is used as the base for the compilation of binaries, +and because of this, never process more than one directory in the same process, +because the compilation may not be ok. To process more than one directory (or project), +just select and process each one independently, in parallel if you like, but in different processes.
+ +### Usage #1 +`FoxBin2Prg.EXE [-c cOutputFile] [-t cOutputFile]` + +| Parameter | Description | +| ----- | ----- | +| none | Call Info screen | +| -c | creates a template config-file _cOutputFile_ ( like FOXBIN2PRG.CFG ) | +| -t | creates a template table-config-file _cOutputFile_ ( like _Tabellenname_.dbf.cfg ) | +### Usage #2 +`FoxBin2Prg.EXE cInputFile [,cType [,cTextName [,lGenText [,cDontShowErrors [,cDebug [,cDontShowProgress [,cOriginalFileName [,cRecompile [,cNoTimestamps [,cCFG_File] ] ] ] ] ] ] ] ] ] ]` + +| Parameter | Value (_Default_) | Description | +| ----- | ----- | ----- | +| cInputFile | fullpath | Full name of the file to convert or directory name to process
without any other parameter given, the extension (and the config) defines the operation| +| | _FileName::ClassName_ | If option UseClassPerFile is 1 or 2, a class-file will be extracted from the lib | +| cType | empty | Fileextension of _cInputFile_ defines operation | +| | BIN2PRG | _cInputFile_ is processed for generating a _Text_ representation. | +| | PRG2BIN | _cInputFile_ is processed for generating the _Binary_ file(s). | +| | INTERACTIVE | A confirmation dialog will be shown when processing a directory asking what to convert.
This option overrides the _BIN2PRG_ and _PRG2BIN_ parameters.
Can be used with or without _PRG2BIN_ or _BIN2PRG_ | +| | SHOWMSG | A status message will be shown on termination. | +| | * | If _cInputFile_ is a project (pj[x2]) all files of the project, **including** the pjx, will be processed. The extension defines direction of operation. | +| | \*\- | If _cInputFile_ is a project (pj[x2]) all files of the project, **excluding** the pjx, will be processed. The extension defines direction of operation. | +| | d, D, K, B, M, R, V | SCCAPI (SCCTEXT.PRG) compatibility mode, query the conversion support for the file type specified
Types: d=DBC, D=DBF, K=Form, B=Label, M=Menu, R=Report, V=Class | +| cTextName | Text filename. | Only for SCCAPI (SCCTEXT.PRG) compatibility mode. File to use. | +| lGenText | .T., .F. | Only for SCCAPI (SCCTEXT.PRG) compatibility mode. .T.=Generates Text, .F.=Regenerates Binary.
**Note:** _cType_ have predominance over _lGenText_ | +| cDontShowErrors | _0_, 1 | '1' for NOT showing errors in MESSAGEBOX | +| cDebug | _0_, 1, 2 | '0 'no debug, '1' for generating process LOGs, stop on errors, '2' like '1' and special log. | +| cDontShowProgress | 0, _1_, 2 | '0' show progress, '1' for **not** showing the process window, '2' Show only for multi-file processing | +| cOriginalFileName | text | used in those cases in which inputFile is a temporary filename and you want to generate the correct filename on the header of the text version | +| cRecompile | 0, _1_ | Indicates recompile ('1') the binary once regenerated.
True if called from SCCAPI (SCCTEXT.PRG) compatibility mode. | +| | path | The binary is compiled from this path | +| cNoTimestamps | 0, _1_ | Indicates if timestamp must be cleared ('1' or empty) or not ('0') | +| cCFG_File | 0, _1_ | Indicates a CFG filename for not using the default on foxbin2prg directory or path. | +#### Note #1 +The _BIN2PRG, PRG2BIN, INTERACTIVE, SHOWMSG_ cTypes might be mixed freely like: +`PRG2BIN-INTERACTIVE` +`BIN2PRG-INTERACTIVE-SHOWMSG` +#### Note #2 +On any combination of (_BIN2PRG_, _PRG2BIN_, _INTERACTIVE_, _SHOWMSG_) separated by a "-", _cType_ and _cInputFile_ parameters can be swapped. +This is useful when used as EXE dealing with Windows shortcuts, +on which fixed parameters must be in the shortcut. +The filename is an external variable parameter received when SendingTo FoxBin2Prg with right-click on File Manager. +## Examples +### Using the "EXE" version: (useful for calling from 3rd.party programs) + +| command | description | +| - | - | +| `FOXBIN2PRG.EXE "\file.scx"` | enerates the Text version | +| `FOXBIN2PRG.EXE "\file.sc2"` | Regenerates the Binary version | +| `FOXBIN2PRG.EXE "\proj.pjx" "*"` | Generates the Text files for all the files in the PJX, including the PJX | +| `FOXBIN2PRG.EXE "\proj.pj2" "*"` | Regenerates the Binary files for all the files in the PJ2 | +| `FOXBIN2PRG.EXE "\proj.pjx" "*-"` | Generates the Text files for all the files in the PJX, excluding the PJX | +| `FOXBIN2PRG.EXE "\file.vcx::cus_client"` | Regenerates only the Text version of the individual class cus_client of file.vcx (with UseClassPerFile:1 or 2) | +| `FOXBIN2PRG.EXE "\proj.pj2" "*" \| find /V ""` | Regenerates the Binary files for all the files in the PJ2 and outputs to stdOut | +### Using the "PRG" version: + +| command | description | +| - | - | +| `DO FOXBIN2PRG.PRG WITH "\file.scx"` | Generates the Text version | +| `DO FOXBIN2PRG.PRG WITH "\file.sc2"` | Regenerates the Binary version | +| `DO FOXBIN2PRG.PRG WITH "\proj.pjx", "*"` | Generates the Text files for all the files in the PJX, including the PJX | +| `DO FOXBIN2PRG.PRG WITH "\proj.pj2", "*"` | Regenerates 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"` | Regenerates only the Text version of the individual class cus_client of file.vcx (with UseClassPerFile:1 or 2) | +### Explorer SenTo: +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. +Hint: **type _shell:sendto_ in File Explorer's address bar and it will open send to folder**, +so you can "send" the selected file (pjx,pj2,etc) to the selected option, +and make on-the-fly conversions, +then rename and edit those shortcuts as this (make sure you can see system file extensions): +``` +Name------------------------ Right-click/Properties/destination----------- +FoxBin2Prg - Binary2Text.lnk \foxbin2prg.exe "BIN2PRG-SHOWMSG" +FoxBin2Prg - Text2Binary.lnk \foxbin2prg.exe "PRG2BIN-SHOWMSG" +FoxBin2Prg.lnk \foxbin2prg.exe "INTERACTIVE-SHOWMSG" +``` \ No newline at end of file diff --git a/Documentacion/github/FoxBin2prg.md b/Documentacion/github/FoxBin2prg.md index 6c26481..4e913e9 100644 --- a/Documentacion/github/FoxBin2prg.md +++ b/Documentacion/github/FoxBin2prg.md @@ -10,7 +10,7 @@ As far as possible these are the original documents. Changes are added where fun This project is part of VFPX. ---- -# FoxBin21Prg - a Binary to Text converter for MS Visual Foxpro 9, SP1 +# FoxBin2Prg - a Binary to Text converter for MS Visual Foxpro 9, SP1 ## Source Original repository at https://github.com/fdbozzo/foxbin2prg, this is a fork available on https://github.com/lscheffler/foxbin2prg/tree/fork diff --git a/foxbin2prg.prg b/foxbin2prg.prg index 926ec3e..0c8e739 100644 --- a/foxbin2prg.prg +++ b/foxbin2prg.prg @@ -644,7 +644,7 @@ If Atc('-BIN2PRG','-'+tc_InputFile) > 0 Or Atc('-PRG2BIN','-'+tc_InputFile) > 0 OR Atc('-SHOWMSG','-'+tc_InputFile) > 0 Or Atc('-INTERACTIVE','-'+tc_InputFile) > 0 ; OR Atc('-SIMERR_I0','-'+tc_InputFile) > 0 Or Atc('-SIMERR_I1','-'+tc_InputFile) > 0 ; OR Atc('-SIMERR_O1','-'+tc_InputFile) > 0; - OR Atc('-C','-'+tc_InputFile) > 0 OR Atc('-T','-'+tc_InputFile) > 0 Then + OR UPPER(tc_InputFile)=='-C' OR UPPER(tc_InputFile)=='-T' Then pcParamX = tc_InputFile tc_InputFile = tcType tcType = pcParamX @@ -29192,12 +29192,12 @@ Define Class CL_LANG As Custom 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) <<>> - <<>>FOXBIN2PRG.EXE [-c FileName] [-t FileName] + <<>>FOXBIN2PRG.EXE [-c OutFileName] [-t OutFileName] <<>> <<>>-- Parameter details: <<>>No parameter: Calls this info screen - <<>>-c creates a template config-file (like FOXBIN2PRG.CFG) - <<>>-t creates a template table-config-file (like .dbf.cfg) + <<>>-c creates a template config-file (like FOXBIN2PRG.CFG) + <<>>-t creates a template table-config-file (like .dbf.cfg) <<>> <<>>FOXBIN2PRG.EXE [cType [cTextName [cGenText [cDontShowErrors [cDebug [cDontShowProgress [cOriginalFileName [cRecompile [cNoTimestamps [cCFG_File] ] ] ] ] ] ] ] ] ] <<>> @@ -29206,12 +29206,13 @@ Define Class CL_LANG As Custom <<>>- If 'BIN2PRG' is specified, the directory specified in tcType is processed for generating TX2 <<>>- If 'PRG2BIN' is specified, the directory specified in tcType is processed for regenerating BIN <<>>- In SCCAPI (VSS) compatibility mode, it is used to query the conversion support for the file type specified + <<>> VSS Types: d=DBC, D=DBF, K=Form, B=Label, M=Menu, R=Report, V=Class <<>>cType: In SCCAPI (VSS) compatibility mode indicates the input file type. <<>>- If specified '*' or '*-' and tc_InputFile is a PJX, all project files are processed <<>>cTextName = Text filename. Only for SCCAPI (VSS) compatibility mode. <<>>lGenText: .T.=Generates Text, .F.=Regenerates Binary. Only for SCCAPI (VSS) compatibility mode. <<>>cDontShowErrors: '1' for NOT showing errors - <<>>cDebug: '1' for generating process LOGs + <<>>cDebug: '1' for generating process LOGs, stop on errors <<>>cDontShowProgress: '1' for NOT showing the process window <<>>cOriginalFileName: used in those cases in which inputFile is a temporary filename and you want to generate the correct filename on the header of the text version <<>>cRecompile: Indicates recompile ('1') the binary once regenerated. You can specify a Path too (ie, the project one) @@ -29381,12 +29382,12 @@ Define Class CL_LANG As Custom TEXT TO .C_FOXBIN2PRG_SYNTAX_INFO_EXAMPLE_LOC TEXTMERGE NOSHOW FLAGS 1 PRETEXT 1+2 <<>>Página principal y descarga de FoxBin2Prg: https://github.com/fdbozzo/foxbin2prg/wiki - Fernando D. Bozzo (2013.11.25) <<>> - <<>>FOXBIN2PRG.EXE [-c FileName] [-t FileName] + <<>>FOXBIN2PRG.EXE [-c OutFileName] [-t OutFileName] <<>> <<>>-- Parameter details: <<>>No parameter: Calls this info screen - <<>>-c creates a template config-file (like FOXBIN2PRG.CFG) - <<>>-t creates a template table-config-file (like .dbf.cfg) + <<>>-c creates a template config-file (like FOXBIN2PRG.CFG) + <<>>-t creates a template table-config-file (like .dbf.cfg) <<>> <<>>FOXBIN2PRG.EXE [cType [cTextName [cGenText [cDontShowErrors [cDebug [cDontShowProgress [cOriginalFileName [cRecompile [cNoTimestamps [cCFG_File] ] ] ] ] ] ] ] ] ] <<>> @@ -29395,12 +29396,13 @@ Define Class CL_LANG As Custom <<>>- Si indica 'BIN2PRG', se procesa el directorio indicado en tcType para generar los TX2 <<>>- Si indica 'PRG2BIN', se procesa el directorio indicado en tcType para generar los BIN <<>>- En modo compatibilidad con SCCAPI (VSS), se usa para preguntar el tipo de soporte de conversión para el tipo de archivo indicado + <<>> VSS Types: d=DBC, D=DBF, K=Form, B=Label, M=Menu, R=Report, V=Class <<>>cType: En modo compatibilidad con SCCAPI (VSS) es el Tipo de archivo de entrada. <<>>- Si indica '*' o '*-' y tc_InputFile es un PJX, se procesa todo el proyecto <<>>cTextName = Nombre del archivo texto. (Solo para compatibilidad con Visual SourceSafe) <<>>lGenText: .T.=Genera Texto, .F.=Genera Binario. Solo para compatibilidad con SCCAPI (VSS) <<>>cDontShowErrors: '1' para NO mostrar errores - <<>>cDebug: '1' para generar LOGs del proceso + <<>>cDebug: '1' para generar LOGs del proceso, stop on errors <<>>cDontShowProgress: '1' para NO mostrar la ventana de progreso <<>>cOriginalFileName: Sirve para los casos en los que inputFile es un nombre temporal y se quiere generar el nombre correcto en la cabecera de la versión texto <<>>cRecompile: Indica recompilar ('1') el binario una vez regenerado. También se puede indicar un Path (p.ej, el del proyecto) @@ -29572,12 +29574,12 @@ Define Class CL_LANG As Custom <<>>FoxBin2Prg Home Page and download: https://github.com/fdbozzo/foxbin2prg/wiki - Fernando D. Bozzo (2013.11.25) <<>> <<>>################################################################################################################ - <<>>FOXBIN2PRG.EXE [-c FileName] [-t FileName] + <<>>FOXBIN2PRG.EXE [-c OutFileName] [-t OutFileName] <<>> <<>>-- Parameter: <<>>Keine Parameter: Startet dieses Formular - <<>>-c Erzeugt eine Vorlage für eine Config-Datei (wie FOXBIN2PRG.CFG) - <<>>-t Erzeugt eine Vorlage für eine Tabellen-Config-Datei (wie .dbf.cfg) + <<>>-c Erzeugt eine Vorlage für eine Config-Datei (wie FOXBIN2PRG.CFG) + <<>>-t Erzeugt eine Vorlage für eine Tabellen-Config-Datei (wie .dbf.cfg) <<>> <<>>**************************************************************************************************************** <<>>FOXBIN2PRG.EXE [cType [cTextName [cGenText [cDontShowErrors [cDebug [cDontShowProgress [cOriginalFileName [cRecompile [cNoTimestamps [cCFG_File] ] ] ] ] ] ] ] ] ] @@ -29587,12 +29589,13 @@ Define Class CL_LANG As Custom <<>> - wenn 'BIN2PRG' spezifiziert ist, wird das Verzeichnis in cType (!!) zum Erstellen der Textdateien genutzt <<>> - wenn 'PRG2BIN' spezifiziert ist, wird das Verzeichnis in cType (!!) zum Erstellen der Binärdateien genutzt <<>> - Im SCCAPI (VSS) Kompatibilitätsmodus, wird dies zur Abfrage der Unterstützung der Umwandlung für den genannten Dateityp genutzt + <<>> VSS Types: d=DBC, D=DBF, K=Form, B=Label, M=Menu, R=Report, V=Class <<>>cType: Im SCCAPI (VSS) Kompatibilitätsmodus wird hier der Dateityp der Input-Datei festgelegt <<>> - Wird hier '*' oder '*-' angegeben, und tc_InputFile ist ein PJX, werden alle Dateien im PJX konvertiert <<>>cTextName: Text Dateiname. Nur im SCCAPI (VSS) Kompatibilitätsmodus. <<>>lGenText: .T.=Erzeuge Text, .F.=Erzeuge Binary. Nur im SCCAPI (VSS) Kompatibilitätsmodus. <<>>cDontShowErrors: '1' Unterdrückt die Anzeige von Fehlern - <<>>cDebug: '1' Erzeugt LOG Dateien + <<>>cDebug: '1' Erzeugt LOG Dateien, Halte bei Fehlern an <<>>cDontShowProgress: '1' Zeige kein Fortschrittsfenster <<>>cOriginalFileName: Falls als Inputdatei eine temporäre Datei genutz wird, kann hier fürden Kopf der Textdatei der richtige Name angegeben werden. <<>>cRecompile: '1' Die erzeugten Binädateien werden nach dem Erzeugen kompiliert. Eine Pfadangabe (d.h., die des Projektes) ist möglich. @@ -29802,12 +29805,12 @@ Define Class CL_LANG As Custom 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) <<>> - <<>>FOXBIN2PRG.EXE [-c FileName] [-t FileName] + <<>>FOXBIN2PRG.EXE [-c OutFileName] [-t OutFileName] <<>> <<>>-- Parameter details: <<>>No parameter: Calls this info screen - <<>>-c creates a template config-file (like FOXBIN2PRG.CFG) - <<>>-t creates a template table-config-file (like .dbf.cfg) + <<>>-c creates a template config-file (like FOXBIN2PRG.CFG) + <<>>-t creates a template table-config-file (like .dbf.cfg) <<>> <<>>FOXBIN2PRG.EXE [cType [cTextName [cGenText [cDontShowErrors [cDebug [cDontShowProgress [cOriginalFileName [cRecompile [cNoTimestamps [cCFG_File] ] ] ] ] ] ] ] ] ] <<>> @@ -29816,12 +29819,13 @@ Define Class CL_LANG As Custom <<>>- If 'BIN2PRG' is specified, the directory specified in tcType is processed for generating TX2 <<>>- If 'PRG2BIN' is specified, the directory specified in tcType is processed for regenerating BIN <<>>- In SCCAPI (VSS) compatibility mode, it is used to query the conversion support for the file type specified + <<>> VSS Types: d=DBC, D=DBF, K=Form, B=Label, M=Menu, R=Report, V=Class <<>>cType: In SCCAPI (VSS) compatibility mode indicates the input file type. <<>>- If specified '*' or '*-' and tc_InputFile is a PJX, all project files are processed <<>>cTextName = Text filename. Only for SCCAPI (VSS) compatibility mode. <<>>lGenText: .T.=Generates Text, .F.=Regenerates Binary. Only for SCCAPI (VSS) compatibility mode. <<>>cDontShowErrors: '1' for NOT showing errors - <<>>cDebug: '1' for generating process LOGs + <<>>cDebug: '1' for generating process LOGs, stop on errors <<>>cDontShowProgress: '1' for NOT showing the process window <<>>cOriginalFileName: used in those cases in which inputFile is a temporary filename and you want to generate the correct filename on the header of the text version <<>>cRecompile: Indicates recompile ('1') the binary once regenerated. You can specify a Path too (ie, the project one)