Better doku 2
This commit is contained in:
@@ -0,0 +1,81 @@
|
||||
# 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.
|
||||
|
||||
----
|
||||

|
||||
This project is part of VFPX.
|
||||
|
||||
----
|
||||
# FoxBin2Prg - Usage in object style
|
||||
FoxBin2Prg might be used as an EXE either from Windows or VFP, or as as prg from inside VFP in a [command line](./FoxBin2Prg_Run.md) way.
|
||||
This document deals with the integration as an VFP Object using VFP based objects.
|
||||
|
||||
For settings, API and other realted stuff see [Internals](./FoxBin2Prg_Internals.md).
|
||||
## Usage
|
||||
### Instantiating
|
||||
Basically, the instantiating of FoxBinPrg is straight forward:
|
||||
```
|
||||
*-- Instancing directly from the EXE (fastest way, only EXE needed)
|
||||
LOCAL loCnv AS c_foxbin2prg OF "FOXBIN2PRG.PRG"
|
||||
SET PROCEDURE TO "<Path>\FOXBIN2PRG.EXE"
|
||||
loCnv = CREATEOBJECT("c_foxbin2prg")
|
||||
loCnv.execute( <params> )
|
||||
```
|
||||
-or this way also-
|
||||
```
|
||||
*-- Instancing from the PRG (you also need various files, like the 27 props*.txt)
|
||||
LOCAL loCnv AS c_foxbin2prg OF "FOXBIN2PRG.PRG"
|
||||
loCnv = NEWOBJECT("c_foxbin2prg", "<Path>\FOXBIN2PRG.PRG")
|
||||
loCnv.execute( <params> )
|
||||
```
|
||||
### Execute()
|
||||
Transforming file(s) works like
|
||||
`obj.execute(cInputFile [,cType [,cTextName [,lGenText [,cDontShowErrors [,cDebug [,cDontShowProgress [,oModule [,oEx [,lRelanzarError [,cOriginalFileName [,cRecompile [,cNoTimestamps [,cBackupLevels [,cClearUniqueID [,cOptimizeByFilestamp [,cCFG_File] ] ] ] ] ] ] ] ] ] ] ] ] ] ])`
|
||||
A lot of the parameters are the same as calling the [command line](./FoxBin2Prg_Run.md),
|
||||
some additional are added and some are not string type.
|
||||
Some settings will overwrite configuration. Using an object as cCFG_File will overwrite all configuration.
|
||||
|
||||
| Parameter | Value (_Default_) | Description |
|
||||
| ----- | ----- | ----- |
|
||||
| cInputFile | fullpath | Full name of the file to convert or directory name to process <br/> 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. <br/> This option overrides the _BIN2PRG_ and _PRG2BIN_ parameters. <br/> 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 <br /> 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. <br/> **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 |
|
||||
| oModule | | Internal use for Unit Testing |
|
||||
| oEx | | Exception object, return for errorhandling |
|
||||
| lRelanzarError | .T.. _.F._ | Throw error to caller of _.Execute()_ |
|
||||
| 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. <br/> 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') |
|
||||
| cBackupLevels | 0, _1_, .. | "0" no Bakup, "1", one level _filename_.bak, "n" n levels of Backup _filename_.n.bak |
|
||||
| cClearUniqueID | 0, _1_ | 0=Keep UniqueID in text files, 1=Clear Unique ID. Useful for Diff and Merge |
|
||||
| cOptimizeByFilestamp | _0_, 1 | 1=Optimize file regeneration depending on file timestamp. <span style="background-color: gold;">Dangerous while working with branches!</span> |
|
||||
| cCFG_File | filename | Indicates a CFG filename for not using the default on foxbin2prg directory or path. |
|
||||
| | object | An object containing configuration options to use. See [Internals](./FoxBin2Prg_Internals.md) for object creation. |
|
||||
#### Note #1
|
||||
The _BIN2PRG, PRG2BIN, INTERACTIVE, SHOWMSG_ cTypes might be mixed freely like:
|
||||
`PRG2BIN-INTERACTIVE`
|
||||
`BIN2PRG-INTERACTIVE-SHOWMSG`
|
||||
#### Note #2:
|
||||
- The swap of _cInputFile_ and _cType_ is not possible here.
|
||||
- Setting _cInputFile_ and _cType_ appropriate, info screen and generation of configuration templates is possible too. See [command line](./FoxBin2Prg_Run.md#usage_1)
|
||||
- While possibe, the SCCAPI (SCCTEXT.PRG) compatibility mode is more an idea of the [command line](./FoxBin2Prg_Run.md).
|
||||
## Return values
|
||||
Return value is 0=OK, 1=Error.
|
||||
|
||||
|
||||
@@ -12,9 +12,12 @@ 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.
|
||||
Additional it might be integrated as an VFP Object using the [Object version](./FoxBin2Prg_Object.md).
|
||||
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.
|
||||
Do the similarity of the call, the prg version takes all parameters as strings too.
|
||||
|
||||
For settings and other realted stuff see [Internals](./FoxBin2Prg_Internals.md).
|
||||
## Main differences
|
||||
### EXE
|
||||
The exe contains the mos controling structures and the program itself.
|
||||
@@ -39,12 +42,12 @@ Remember that using the prg style, parameters must be wrapped in string delimite
|
||||
#### Note
|
||||
Do to the compatibility with VSS the usage of _cInputFile_ and _cType_ is odd.
|
||||
#### Important note:
|
||||
<div style="background-color: gold;"> When you process a directory, it is used as the base for the compilation of binaries,
|
||||
<span style="background-color: gold;"> 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.</div>
|
||||
just select and process each one independently, in parallel if you like, but in different processes.</span>
|
||||
|
||||
### Usage #1
|
||||
### Usage 1
|
||||
`FoxBin2Prg.EXE [-c cOutputFile] [-t cOutputFile]`
|
||||
|
||||
| Parameter | Description |
|
||||
@@ -52,7 +55,7 @@ just select and process each one independently, in parallel if you like, but in
|
||||
| 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
|
||||
### Usage 2
|
||||
`FoxBin2Prg.EXE cInputFile [,cType [,cTextName [,lGenText [,cDontShowErrors [,cDebug [,cDontShowProgress [,cOriginalFileName [,cRecompile [,cNoTimestamps [,cCFG_File] ] ] ] ] ] ] ] ] ] ]`
|
||||
|
||||
| Parameter | Value (_Default_) | Description |
|
||||
@@ -76,7 +79,7 @@ just select and process each one independently, in parallel if you like, but in
|
||||
| cRecompile | 0, _1_ | Indicates recompile ('1') the binary once regenerated. <br/> 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. |
|
||||
| cCFG_File | filename | 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`
|
||||
@@ -86,6 +89,8 @@ On any combination of (_BIN2PRG_, _PRG2BIN_, _INTERACTIVE_, _SHOWMSG_) separated
|
||||
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.
|
||||
## Return values
|
||||
Return value via _ErrorLevel_ is 0=OK, 1=Error.
|
||||
## Examples
|
||||
### Using the "EXE" version: (useful for calling from 3rd.party programs)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user