Giter Site home page Giter Site logo

fdbozzo / foxbin2prg Goto Github PK

View Code? Open in Web Editor NEW
59.0 59.0 35.0 166.97 MB

Visual FoxPro 9 Binary to Text and Text to Binary converter. Replacement for SCCText(X) and TwoFox that is bi-directional (Text is editable)

Home Page: https://vfpx.codeplex.com/wikipage?title=FoxBin2Prg

License: MIT License

SQLPL 18.32% xBase 79.27% HTML 0.63% NSIS 0.03% Batchfile 0.01% PowerShell 0.16% VBScript 1.57%

foxbin2prg's People

Contributors

doughennig avatar fdbozzo avatar lscheffler avatar rboatright avatar t-zuidema avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

foxbin2prg's Issues

HomeDir is generated in pj2 file causing git changes every time

I'm trying to make sense of foxbin2prg usage scenario in our git workflow.

I have generated pj2 files for our projects, but what I don't understand is why HomeDir, Debug and couple of other settings are still stored in text file? This means that every time different developer regenerates pj2 file it is marked as changed by git. Can something be done about this, or maybe this is a limitation of VFP?

As far as I understand this VFP parameter is user-defined and should not appear in global settings of the repository for other developers.

Trailing spaces are lost for memo fields converting dbf with including data.

ℹ Computer information

  • VFP version: 9.0 sp2
  • FoxBin2PRG version: latest
  • Last FoxBin2PRG version w/o bug (if available):

📝 Provide detailed reproduction steps (if any)

Trailing spaces are lost for memo fields converting dbf with including data.
Convert SpaceBug.DBF to reproduce problem
I fixed this problem in added foxbin2prg by replacing space with a placeholder and restore them later.

✔️ Expected result

Keep Trailing spaces for memo fields

❌ Actual result

Trailing spaces are lost for memo fields

📷 Screenshots

foxbin2prg.PRG.txt
SpaceBug.DBF.txt
SpaceBug.FPT.txt

Support for VFP Advanced

📝 Provide a description of the new feature

What is the expected behavior of the proposed feature? What is the scenario this would be used?
At the moment when it generates the binary...it create FoxPro 9 compiled objects. How about adding the support to allow for it to create VFP Advanced objects?

If you'd like to see this feature implemented, add a 👍 reaction to this post.

Cannot generate SC2 file from one particular SCX/SCT form.

FoxBin2Prg has stopped working with this particular Form (SCX/SCT) for some reason. It used to work fine with this file. Zip files attached containing 2 files. I call the

Quotes-Matt-Slay-Issue.zip

I call it this way:

Do "H:\Thor\Thor\Tools\Components\FoxBIN2PRG\FoxBin2Prg.prg" with "H:\Work\lm5\forms\Quotes.scx"

The UI progress bar appears briefly and then disappears, but no SC2 files is generated, and no errors are shown.

Problem regenerating class

If I select a single lib1.class1.vc2 file and try to generate the binary version, nothing is stored to the classlib lib1.vcx (IOW no class is generated).

This is true with version 1.19.48 as well as for 1.19.49

If I select the whole lib (lib1.vc2) I get an error

2017-12-03T13:35:10  ----------------------------------------------------------------------------------------------------
Error 1924, LOCLASE is not an object.
writebinaryfile, 10389
LOCATE FOR PLATFORM == PADR('WINDOWS', FSIZE('PLATFORM')) AND OBJNAME == loClase._ObjName
FoxBin2Prg: [E:\SE\VFPX\FOXBIN2PRG\FOXBIN2PRG.FXP] (EXE Version: v1.19.49)
tc_InputFile = [E:\SE\MWL\LIBRARY\AV.VC2]

Source file: E:\SE\MWL\library\av.vc2

Verion number in ??2 files

The version number in the ??2 files is just nn.nn

It would be better to have nn.nn.nn, or since you use this in git nn.nn.nn.nn so one can

  • go back to a working version
  • give better description of error

Incompatible with VFPA

It must be doing some version checking that isn't expecting VFPA. A simple fix would be to invoke SYS(9018,0) to make VFPA return older version information. VFP9 and earlier would be unaffected.

Error 1098, Incorrect VFP 9 version - Missing SP1! Expected: 3504 or later, actual: 10.00.0000.1909
execute, 2902
FoxBin2Prg: [C:\DEV\FOX\THOR\THOR\THOR\TOOLS\COMPONENTS\FOXBIN2PRG\FOXBIN2PRG.EXE] (EXE Version: v1.19.51)

Error in Log

I'm not sure if this is pointing to a larger problem or not, but the individual file log has incorrect info. The identified input file and the original file name are two different files (see the attached example). What is going on here Fernando?
FSCAN.SCX.LOG

Convert menu mn2 to mnx with skip for that contains a string with ; sign is missing part after that sign in mnx.

ℹ Computer information

  • VFP version: 9.0 sp2
  • FoxBin2PRG version: latest
  • Last FoxBin2PRG version w/o bug (if available):

📝 Provide detailed reproduction steps (if any)

I had a problem with converting mn2 files back to mnx files when skip for contains a string with ; sign. See mn2 file to reproduce this problem
I fixed this see attached .prg file by Added new method remove_strings (Remove all things between quotes) and Adjusted Procedure analyzeCodeBlock_DefineBAR of Class CL_MENU_OPTION.
With this fix I can convert all our menu files without errors

✔️ Expected result

Correct skip for in mnx

❌ Actual result

Missing part after ; sign in skip for in mnx

📷 Screenshots

foxbin2_patch.prg.txt
qth_men.mn2.txt

Are there any useful screenshots? WinKey+Shift+S and then just paste them directly into the form

OLE error code 0x80030050: Unknown COM status code.

I have some vcx file in my test project, which has OLE control class. Now I convert this class to text file. When I try to convert it back to binary, at first everything seems alright.
But, when I try to modify this class, I receive error

OLE error code 0x80030050: Unknown COM status code.

picture_1

In test project is in before folder _datetime.vcx before conversion to text file.

Inline Comments - Error 1098, Cannot find ... [ENDT] that closes ... [TEXT]

It seems there is an Issue with Inline comments, see Code and Log

Code snippet:

create cursor (lcTabelle) (;
    SOME_ID N(4),; 
    TEXT C(50),; && This is Any Comment
    SOME_OTHER N(10,2);
    )

Log:

2018-07-09T10:28:58  ----------------------------------------------------------------------------------------------------
Error 1098, Cannot find end marker [ENDT] that closes start marker [TEXT] on line 18
identifyexclusionblocks, 7133

Error location ..............................
Method: leistungscontainer.erstelle_cursor, Line 17
> 	TEXT C(50),; && This is Any Comment
Recno: 223
.............................................
FoxBin2Prg: [C:\PORTABLEAPPS\FOXBIN2PRG\FOXBIN2PRG.EXE] (EXE Version: v1.19.51)

Not handling long _MemberData properly

SQConfigEngine in SQConfig.vcx in the attached zip file has 7945 characters in _MemberData. The XML in _MemberData has no carriage return (CHR(13)) or linefeed (CHR(10)) characters. When I convert it to a VC2 file and then back to a VCX file and edit the class, I get a "Property '_memberdata' value is too long" error message if I select the _MemberData property in the Properties window and then click on the Class or right-click and choose Zoom. The reason is because the XML is now 8071 characters. The extra length is caused by linefeed characters at the end of each tag.

FoxBin2PRG should not insert CHR(10) if it was not in the original text (actually, in the specific case of _MemberData, you can leave out CHR(13), CHR(10), and CHR(9) since they are not required).

Test.zip

Issue with pj2 PRG2BIN in <TextFiles> section when path has parentheses - ")"

I am getting this error on converting some of my pj2 files with PRG2BIN:

2016-07-10T13:51:44  ----------------------------------------------------------------------------------------------------
Error 36, Command contains unrecognized phrase/keyword.
analyzecodeblock_textfiles, 11436
lcFile          = LOWER( ALLTRIM( STRTRAN( CHRTRAN( NORMALIZE( STREXTRACT( tcLine, ".ITEM(", ")", 1, 1 ) ), ["], [] ), 'lcCurDir+', '', 1, 1, 1) ) )
FoxBin2Prg: [C:\VFP_SOURCE\FOXBIN2PRG\FOXBIN2PRG.EXE] (EXE Version: v1.19.47)
tc_InputFile = [C:\VFP_SOURCE\VFPAPPS\TEST.PJ2]

This also happens in the most recent preview.

I've traced it down to this minimal example:

    *<TextFiles>
    .ITEM(lcCurdir + '..\..\..\program files (x86)\microsoft visual foxpro 9\ffc\_frxcursor.h').Type = 'T'
    *</TextFiles>

Looking in foxbin2prg.prg, I see that the STREXTRACT() in analyzecodeblock_textfiles is the only one that doesn't have something more after the cEndDelim ")" parameter. For example, analyzeCodeBlock_ExcludedFiles has ").Exclude".

So perhaps line 11436 should change ")" to ").Type" like so:

lcFile          = LOWER( ALLTRIM( STRTRAN( CHRTRAN( NORMALIZE( STREXTRACT( tcLine, ".ITEM(", ").Type", 1, 1 ) ), ["], [] ), 'lcCurDir+', '', 1, 1, 1) ) )

Tables without indexes cause an error that the "Table ____ is not marked as belonging to the _____ database

ℹ Computer information

  • VFP version: VFP9 SP2
  • FoxBin2PRG version: 1.19.62

📝 Provide detailed reproduction steps (if any)

When converting a database table that doesn't have any indexes from a db2 to a dbf, the table no longer belongs to the proper database.

✔️ Expected result

The indexless table should remain attached to the proper database

❌ Actual result

When dbf is created it appears to be tagged to a "_fb2p.dbc" database and no longer part of our "lwdata.dbc". This causes an error when trying to open this table.

📷 Screenshots

image
image

ThorUpdater zip, double filename

The FoxBin2Prg.zip in the Thor updater contains files that are identical for WINDOWS / DOS world.
This is TESTS\DATOS_READONLY\ folder, some abc.MNT / abc.mnt pairs.
Looks like the PS updater mixes up cases while tipping, or the zip is created with a non WINDOWS based tool.
I rebuild the zip for the next version from scratch.

Converting MN2 to MNX ignores the programmer-defined bar # found in "Prompt Options" screen

ℹ Computer information

  • VFP version: 9.0 SP2
  • FoxBin2PRG version: 1.19.63

📝 Provide detailed reproduction steps (if any)

See attached files. MN2 has been created from the binaries.

As can be seen in the screenshot, the last menu item in the Reports sub-menu is assign Bar # 999.

However, when you re-create the binaries from the MN2 file, the bar # is gone. (There are about a dozen such bar #s in this menu -- they all disappear)

Samples.zip

✔️ Expected result

The re-created MNX should have the bar numbers found in the original.

❌ Actual result

They bar #s are gone, so that code referencing them croaks.

📷 Screenshots

image

Are there any useful screenshots? WinKey+Shift+S and then just paste them directly into the form

Missing documentation

CodePlex has more documentation for FoxBin2PRG than here on GitHub. I have attached the missing files from CodePlex so you can update the documentation here.

FoxBin2PRG.zip

Incorrect version showing for v1.19.65

ℹ Computer information

  • VFP version: 9
  • FoxBin2PRG version: v1.19.65
  • Last FoxBin2PRG version w/o bug (if available): v1.19.63

📝 Provide detailed reproduction steps (if any)

When running Txt -> Bin the progress bar is showing v1.19.64 even though v1.19.65 is installed.

Also this repo has releases till only v1.19.62 and unable to find later releases and notes.

✔️ Expected result

  • Should show v1.19.65 on title bar when running FoxBin2Prg
  • Is it possible to have releases and notes in Github?

❌ Actual result

  • Showing v1.19.64 on title bar when running FoxBin2Prg v1.19.65
  • Releases notes unavailable in Github for >v1.19.62

📷 Screenshots

image

Converting MN2 to MNX Type 78 "Bar #"

ℹ Computer information

  • VFP version: VFP9SP2
  • FoxBin2PRG version: 1.19.63

📝 Provide detailed reproduction steps (if any)

  1. Create Menu
  2. Add PAD type Bar # (internal OBJCODE 78) with number in column 4
  3. Run Bin2Text
  4. Run Text2Bin
  5. Check Result

✔️ Expected result

Bar number in column 4

❌ Actual result

Column 4 is empty

Additional info

This is similiar to #61, where the Bar # of none Bar Type PADs will not be regenerated.

Objects of classes missing

The latest release does not store objects of classes om my comp. The vc2 file just holds the class and the properties and methods of it, but not the objects and there methods.

If switched to this version of FoxBin2PRG after a long time of just using.

Edit:

This is the master branch. If I should use a more recent one, blease notify me.

Error in latest build 1.19.57

I receive the following error when using the updated version 1.19.57:

**Error 12, Variable 'LNFILECOUNT' is not found.
get_filesfromdirectory, 5208
DO c:\vfputils\thor\tools\components\foxbin2prg\foxbin2prg.exe WITH "SHOWMSG-PRG2BIN", "C:\Source\Repos\brokerWOLF\lwapp"

FoxBin2Prg: [C:\VFPUTILS\THOR\TOOLS\COMPONENTS\FOXBIN2PRG\FOXBIN2PRG.EXE] (EXE Version: v1.19.57)
lcInputFile_Type = [D]
tc_InputFile = [C:\Source\Repos\brokerWOLF\lwapp]

Source file: C:\Source\Repos\brokerWOLF\lwapp**

As you can see, the parameter name is 'tnFileCount' but line 5208 is using '@lnFileCount'.

bin2prg

Vistas remotas se corrompen al convertir de texto a binario cuando nombre de vista tiene una o más letras mayúsculas

Me ha sucedido que luego de renombrar una vista remota a un nombre que contiene una o más letras mayúsculas y luego convertir el DBC a su respectivo archivo .DC2 con FoxBin2Prg para luego volver a generar el DBC desde el mismo .DC2, las vistas remotas cuyos nombres son todas letras minúsculas se regeneran bien, pero las vistas que tienen una o más letras mayúsculas pierden el orden y las propiedades de los campos y las vistas no se pueden modificar desde el Administrador de Proyectos de VFP9.

Adjunto archivop .ZIP que contiene ejemplos de vistas y además una versión de FoxBin2Prg que corrige esa falla y pueda servir como base para su corrección oficial.

Saludos.
DBC_Pruebas.zip

Converting MN2 to MNX ignores the programmer-defined "Pad Name" found in "Prompt Options" screen

ℹ Computer information

  • VFP version: 9.00.0000.5815
  • FoxBin2PRG version: 1.19.64
  • Last FoxBin2PRG version w/o bug (if available):

📝 Provide detailed reproduction steps (if any)

MN2 files show the Pad Names but they are ignored when re-creating the MNX files

It appears that this can be fixed in method analyzeCodeBlock_DefinePAD by adding the few lines of code (in red) below

image

✔️ Expected result

What is the expected result of the above steps?

❌ Actual result

What is the actual result of the above steps?

📷 Screenshots

image

Are there any useful screenshots? WinKey+Shift+S and then just paste them directly into the form

Error Log is not being written when there is an error in SCX file...

I am still exploring the FoxBin2Prg.prg code to see how it works when it finds an error in a SCX or VCX file.

When stepping through the code in debugging mode I was able to find the .c_TextError property for this current error case I had (see text below), but the only problem is that FoxBin2Prg did not write this code to a log file, not that I could tell.

After processing the SCX file, the .writeErrorLog_Flush() method was not called because the property lnCodError was 0, but there really was an error in the SCX file, as you can see in the .c_TextError property:

.c_TextError property:

    2018-11-03T06:20:42  ----------------------------------------------------------------------------------------------------
    ERRORS FOUND IN FILE [C:\Temp\quotes.scx]
    * Duplicated Object "btn_delete_small.formquotes.menutoolbar1.cmdnew" @Recno 74, (1st.Recno:73)
    * Duplicated Object "btn_delete_small.formquotes.menutoolbar1.cmdnew" @Recno 75, (1st.Recno:73)
    * Duplicated Object "btn_delete_small.formquotes.menutoolbar1.cmdnew" @Recno 76, (1st.Recno:73)
    * Duplicated Object "btn_delete_small.formquotes.menutoolbar1.cmdnew" @Recno 77, (1st.Recno:73)

(You can test this yourself with the ZIP file I attached in my previous Issue which has the SCX/SCT files which have this error.)

Here is the code that should have written the error log file (see screenshot attachment)

2018-11-03_6-28-57

Ignoring extention in foxbin2prg.cfg

1.19.61 ignores extentions in foxbin2prg.cfg
In all of my foxbin2prg.cfg:
extension: pj2=pjm
extension: vc2=vca
extension: sc2=sca
extension: fr2=fra
extension: lb2=lba
extension: mn2=mna
extension: db2=dba
extension: dc2=dca

After update to version 1.19.61 I got this:


FoxBin2Prg INIT - 2021-03-30T09:57:11


FoxBin2Prg: [D:\WORK\TOOLS\FOXBIN2PRG\FOXBIN2PRG.EXE] (EXE Version: v1.19.61, FoxPro Version: 09.00.0000.7423)

  • Internal CFG: / External CFG: C:\PROGRA2\MI61F21\CONFIG.FPW / CodePage Used: 1251)

READING CFG VALUES FROM DISK:
Using configuration file: D:\WORK\TOOLS\FOXBIN2PRG\FOXBIN2PRG.CFG
FOXBIN2PRG.CFG > tcDebug: 1


MAIN EXECUTION 2021-03-30T09:57:11


EXTERNAL PARAMETERS:
tc_InputFile: D:\Work\Italika\Forms\frm8.scx
tcType: BIN2PRG
tcTextName: 0
tlGenText: 0
tcDontShowErrors: 1
tcDebug: 1
tcDontShowProgress: 1
tlRelanzarError: (empty)
tcOriginalFileName: (empty) -> Will use Default []
tcRecompile: D:\Work\Italika\Forms
tcNoTimestamps: 1
tcBackupLevels: (empty) -> Will use Default [1]
tcClearUniqueID: (empty) -> Will use Default [.T.]
tcOptimizeByFilestamp: (empty) -> Will use Default [0]

CACHING CONFIG FOR DIRECTORY: D:
- Inheriting from: D:\WORK\TOOLS\FOXBIN2PRG\FOXBIN2PRG.CFG
CACHING CONFIG FOR DIRECTORY: D:\WORK
- Inheriting from: D:\WORK\TOOLS\FOXBIN2PRG\FOXBIN2PRG.CFG
CACHING CONFIG FOR DIRECTORY: D:\WORK\ITALIKA
- Inheriting from: D:\WORK\TOOLS\FOXBIN2PRG\FOXBIN2PRG.CFG

READING CFG VALUES FROM DISK:
Using configuration file: D:\WORK\ITALIKA\FOXBIN2PRG.CFG
FOXBIN2PRG.CFG > ShowProgressbar: 1

CACHING CONFIG FOR DIRECTORY: D:\WORK\ITALIKA\FORMS
- Inheriting from: D:\WORK\ITALIKA\FOXBIN2PRG.CFG

READING CFG VALUES FROM DISK:
Using configuration file: D:\WORK\ITALIKA\FORMS\FOXBIN2PRG.CFG

Using this settings:
CFG_Actual: 5 [SECONDARY]
CFG_CachedAccess: .F.
tc_InputFile: D:\Work\Italika\Forms\frm8.scx
Foxbin2prg_ConfigFile: D:\WORK\ITALIKA\FORMS\FOXBIN2PRG.CFG
Language: EN ((auto))
ShowProgressbar: 0
ShowErrors: .F.
ExtraBackupLevels: 1
BackgroundImage: D:\WORK\TOOLS\FOXBIN2PRG\foxbin2prg.jpg(Internal default)
Debug: 1
HomeDir: 1
PJX_Conversion_Support 2
VCX_Conversion_Support 2
SCX_Conversion_Support 2
FRX_Conversion_Support 2
LBX_Conversion_Support 2
MNX_Conversion_Support 2
DBF_Conversion_Support 1
DBC_Conversion_Support 2
FKY_Conversion_Support 1
MEM_Conversion_Support 1
UseClassPerFile: 0
ClassPerFileCheck: .F.
RedirectClassPerFileToMain: .F.
RedirectClassType: 0
OldFilesPerDBC: .T.
UseFilesPerDBC: 0
RedirectFilePerDBCToMain: .F.
ItemPerDBCCheck: .F.
DBF_BinChar_Base64: .T.
DBF_IncludeDeleted: .F.
NoTimestamps: .T.
ClearUniqueID: .T.
OptimizeByFilestamp: 0
RemoveNullCharsFromCode: .T.
RemoveZOrderSetFromProps: .F.
PRG_Compat_Level: 0
Recompile: .T. (D:\Work\Italika\Forms)
BodyDevInfo: 0
ClearDBFLastUpdate: .T.
ExcludeDBFAutoincNextval: 0
DBF_Conversion_Included
DBF_Conversion_Excluded
DBF_BinChar_Base64: .T.
DBF_IncludeDeleted: .F.
extension: VC2 VC2
extension: SC2 SC2
extension: FR2 FR2
extension: LB2 LB2
extension: MN2 MN2
extension: DB2 DB2
extension: DC2 DC2
extension: FK2 FK2
extension: ME2 ME2

Option: BIN2PRG
InputFile is a FILE


CONVERSION PROCESS 2021-03-30T09:57:11


USING THIS SETTINGS: D:\WORK\ITALIKA\FORMS\FOXBIN2PRG.CFG => D:\Work\Italika\Forms\frm8.scx
c_OriginalFileName: D:\Work\Italika\Forms\frm8.scx

* Names capitalization program [D:\WORK\TOOLS\FOXBIN2PRG\filename_caps.exe] found
c_foxbin2prg.changefileattribute >> [D:\Work\Italika\Forms\frm8.SC2] lnRet = 0, dwFileAttributes_Orig = -1

Converting file D:\Work\Italika\Forms\frm8.**SC2**...
	- File: D:\Work\Italika\Forms\frm8.**SC2** (352.14/352.14 KiB)

FoxBin2Prg UNLOAD - 2021-03-30T09:57:14


Project build setting to auto increment version always serialized as "0"

To test, I changed the build setting to auto increment version number using both Project Manager and Project Explorer, then serialize the project. No matter what the state or which tool I use to set it, the serialization line reads:

_AutoIncrement = "0"

We code on branches and build on our main branch. We re-gen the binary project from the .pj2 when switching branches. With this issue, we have to manually enable the auto increment after every re-gen of the .pjx. This is fairly new, we think. The problem showed up for us sometime in the last several months, but we assumed it was our process until I got around to specifically testing today.

Making FoxBin2Prg COM friendly

See bottom for attached DIFF showing 3 lines of code I'm suggesting be added (2) or changed (1).
I wanted to make processing the foxbin2prg over 7000 times for one of our projects a little less annoying.
FoxPro executables have a quirk. The simplest one that just quits right after it starts, even with SCREEN=OFF in an embedded CONFIG.FPW file will steal the focus, then let it go again.
This leaves the computer unusable for an hour as it processes all the commands I'm running.

Background: I'm converting VSS to Git. Running a VSS command to get files of a specific version from VSS, if it needs to be converted, run the FoxBin2Prg, then run a Git command to stage the appropriate file. Then when the comment changes from VSS, commit the changes to Git.

I wrote a small COM DLL that uses the EXE as source for the c_foxbin2prg class. Set the l_CancelWithEscKey = .F. and n_ShowProgressBar = 0. Then call the Execute method.
I found there are a few commands in the FoxBin2Prg that don't work in the COM environment. ON ESCAPE and MESSAGEBOX. Setting the l_CancelWithEscKey needs a change in the class to skip the ON ESCAPE. llEscKeyRestored is .T. when it reaches the Finally clause to avoid the ON ESCAPE in there.

My diff of what I actually changed is attached. Trying to send a pull request has code page changes.
foxbin2prg.prg.diff.txt

Documentation

I started moving documentation from Codeplex into the wiki.

Once I get those edited clean, it would make sense to incorporate them into the project in a "docs" or "documentation" folder, possibly as PDFs.

After vc2 convert back to vcx class is corrupted no errors reported

ℹ Computer information

  • VFP version: 9 sp2
  • FoxBin2PRG version: latest
  • Last FoxBin2PRG version w/o bug (if available):

📝 Provide detailed reproduction steps (if any)

After vc2 convert back to vcx class is corrupted no errors reported

problem caused by code:

Procedure ignoreCorruptedObjects(lcCursor)
  • Issue#17 - Error, The specified key already exists

  • Para evitar este error se deben ignorar los objetos corruptos (duplicados)

  • Se identifican porque la clase principal el campo Reserved1 tiene vacio en vez de "Class"
    Local lcParentObjName, lcSetDeleted
    Select (lcCursor)
    lcSetDeleted = Set("Deleted")
    Set Deleted Off

      Scan For PLATFORM = "WINDOWS" And Empty(Parent) And Empty(RESERVED1)
      	lcParentObjName	= Lower(OBJNAME)
      	Delete
      	Skip
      	Delete Rest While Getwordnum(Lower(Parent) + '.', 1, '.') == lcParentObjName
      	Skip -1
      Endscan
    
      Set Deleted &lcSetDeleted.
      Return
    

    Endproc

suggested fix:

Procedure ignoreCorruptedObjects(lcCursor)
  • Issue#17 - Error, The specified key already exists

  • Para evitar este error se deben ignorar los objetos corruptos (duplicados)

  • Se identifican porque la clase principal el campo Reserved1 tiene vacio en vez de "Class"
    Local lcParentObjName, lcSetDeleted
    Select (lcCursor)
    lcSetDeleted = Set("Deleted")
    Set Deleted Off

      Scan For PLATFORM = "WINDOWS" And Empty(Parent) And Empty(RESERVED1)
      	lcParentObjName	= Lower(OBJNAME)
      	Delete
      	**IF (NOT EMPTY(lcParentObjName))**	
      		Skip
      		Delete Rest While Getwordnum(Lower(Parent) + '.', 1, '.') == lcParentObjName
      		Skip -1
      	**ENDIF**	
      Endscan
    
      Set Deleted &lcSetDeleted.
      Return
    

    Endproc

✔️ Expected result

a valid vcx with all classes

❌ Actual result

corrupt vcx missing classes. this is reported bij vfp when open in a class browser

📷 Screenshots

Edit needed to readme file...

I think you should remove this text from the readme file, as I think it is not accurate to be here in the master repo:

Why this fork?
This is a fork of Fernando D. Bozzo 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 VFPX Picture.

I do not maintain the spanish documentation - it would fade. So just check Fernados repo for this information .

Converting back a vcx from a vc2 a error is reported incorrect Class defined twice Error 1098.

ℹ Computer information

  • VFP version: 9 sp2
  • FoxBin2PRG version: 1.19 (latest)
  • Last FoxBin2PRG version w/o bug (if available):

📝 Provide detailed reproduction steps (if any)

Converting back a vcx from a vc2 a error is reported incorrect Class defined twice.
This happens when name of control is same as name of control used on form

See sample attachment vc2 file if converted back to vcx problem is reported

Error 1098,
Class defined twice.

problem is caused by the following code:
SELECT TABLABIN
LOCATE;
FOR OBJNAME==loClase._ObjName
IF FOUND() THEN
*SF 20211207
*SET STEP ON
Error loLang.C_ClassTwice_Header_LOC + ;
loLang.C_ClassTwice_Lib_LOC + JUSTFNAME( DBF() ) + ;
loLang.C_ClassTwice_Class_LOC + loClase._ObjName+0h0D0A
ENDIF &&FOUND()

✔️ Expected result

No error

brl_obj.VC2.txt

Tabs stripped out of memos when DB2 is converted to DBF

When FoxBin2PRG converts a DB2 file to a DBF file and imports the data (using DBF_Conversion_Support = 8), tabs at the start of lines in memo fields are lost because the Set_Line method of CL_CUS_BASE uses this code:

tcLine 	= LTRIM( taCodeLines(I), 0, CHR(9), ' ' )

For example:

	This is some text

becomes:

This is some text

when FoxBin2PRG restores the data.

I think the Set_line method of CL_CUS_RECORD should override this method and use:

tcLine 	= taCodeLines(I)

instead. That way, data is correctly restored.

Problem in latest update 1.19.64

ℹ Computer information

VFP version: VFP9SP2
FoxBin2PRG version: 1.19.64

📝 Provide detailed reproduction steps (if any)

I have not been able to verify that the updates for MN2 to MNX files work using today's update.

1 -- I took an existing menu
2 -- Made a minor modification to a caption and also to a call to a method from the menu item
3 -- Generate Menu
4 -- Committed and Pushed

Bill A pulled and run the menu. My changes were not there.

However -- they were there in the MN2 file and other files. We noted that the MPX had not changed (but have no idea whether this is relevant).

Furthermore, when Bill went in to modify the menu, he could see my changes; even after regenerated the menu and save it, his changes did not show up when he ran it.

✔️ Expected result

What is the expected result of the above steps?

❌ Actual result

What is the actual result of the above steps?

📷 Screenshots

Are there any useful screenshots? WinKey+Shift+S and then just paste them directly into the form

Error, The Specified Key already exists

I'm receiving the following error while trying to diff a classlib.

The class is properly stringified if i use scctext.

2018-01-30T12:24:00  ----------------------------------------------------------------------------
Error 2062, The specified Key already exists.
ignoreincorrectdefinedobjects, 13951
DO c:\portableapps\foxbin2prg\foxbin2prg.exe WITH "C:\...\adresse.vcx"


Error location ..............................
Class: frm_adr_allgemein.Mm_kreditlimitueberwachung
> (no evaluated code yet)
Recno: 368
.............................................
FoxBin2Prg: [C:\PORTABLEAPPS\FOXBIN2PRG\FOXBIN2PRG.EXE] (EXE Version: v1.19.49)
tc_InputFile = [C:\...\ADRESSE.VCX]

Source file: C:\...\adresse.vcx

Config:

ShowProgressbar: 0
UseClassPerFile: 1
ClassPerFileCheck: 1
ClearUniqueID: 0

double classes in VCX

ℹ Computer information

  • VFP version: VFP 9 SP2 / VFPA
  • FoxBin2PRG version: 1.19.66
  • Last FoxBin2PRG version w/o bug (if available): n/a

📝 Provide detailed reproduction steps (if any)

  1. Create binaries from pjx
  2. foxbin2prg.cfg is from
  • foxbin2prg-base
  • a sub folder
  1. other project use different foxbin2prg.cfg set
  • foxbin2prg-base
  • project
  • a sub folder

✔️ Expected result

Every class is single per VCX

❌ Actual result

One VCX holds all classes twice

Problem with sorting property and outlooknavbar (ThemedControls)

Hi,
I use in one of my projects the outlooknavbar. If I use bin2text and then text2bin, the overflowpanel is always collapsed and the defined Panels are not shown correctly.
I looked at the code of foxbin2prg and found out that I can make it function correctly by disabling l_PropSort_Enabled.
The problem is caused by the init order of the child objects in the outlooknavbar. The splitter object has to be added before the panes object, but the sort destroys this.
For properties I can change the sorting order, but not for the objects.
Wrong Order:

ADD OBJECT 'Themedoutlooknavbar' AS themedoutlooknavbar WITH ;
		Comment = "<NORESIZE>", ;
		displayshrinkbutton = .T., ;
...
		overflowpanel.HelpContextID = 201010, ;
		overflowpanel.Left = 0, ;
...
		Panel.HelpContextID = 201010, ;
		Panel.Left = 0, ;
...
		panelvertical.Anchor = 5, ;
		panelvertical.Enabled = .F., ;
...
		panes.Anchor = 15, ;
		panes.ErasePage = .T., ;
...
		panes.Pane1.Caption = "Adressen", ;
		panes.Pane1.HelpContextID = 201010, ;
...
		panes.Pane2.Caption = "Kontakte", ;
		panes.Pane2.HelpContextID = 201010, ;
...
		panes.Pane3.Caption = "Auftragsbearbeitung", ;
		panes.Pane3.HelpContextID = 201010, ;
...
		panes.Pane4.Caption = "Kartendarstellung", ;
		panes.Pane4.HelpContextID = 201410, ;
...
		panes.Top = 28, ;
		panes.Width = 198, ;
		shrinkbutton.HelpContextID = 201010, ;
		shrinkbutton.Name = "shrinkbutton", ;
		Splitter.HelpContextID = 201010, ;
		Splitter.imgBackground.Name = "imgBackground", ;
...
		Title.HelpContextID = 201010, ;
		Title.imgBackground.Name = "imgBackground", ;
...
		*< END OBJECT: ClassLib="..\lib\themedcontrols.vcx" BaseClass="container" />

Correct order:

	ADD OBJECT 'Themedoutlooknavbar' AS themedoutlooknavbar WITH ;
		Comment = "<NORESIZE>", ;
		displayshrinkbutton = .T., ;
...
		panelvertical.Anchor = 5, ;
		panelvertical.Enabled = .F., ;
...
		Title.HelpContextID = 201010, ;
		Title.imgBackground.Name = "imgBackground", ;
...
		overflowpanel.HelpContextID = 201010, ;
		overflowpanel.Left = 0, ;
...
		shrinkbutton.HelpContextID = 201010, ;
		shrinkbutton.Name = "shrinkbutton", ;
		Panel.HelpContextID = 201010, ;
		Panel.Left = 0, ;
...
		Splitter.HelpContextID = 201010, ;
		Splitter.imgBackground.Name = "imgBackground", ;
...
		panes.Anchor = 15, ;
		panes.ErasePage = .T., ;
...
		panes.Pane1.Caption = "Adressen", ;
		panes.Pane1.HelpContextID = 201010, ;
...
		panes.Pane2.Caption = "Kontakte", ;
		panes.Pane2.HelpContextID = 201010, ;
...
		panes.Pane3.Caption = "Auftragsbearbeitung", ;
		panes.Pane3.HelpContextID = 201010, ;
...
		panes.Pane4.Caption = "Kartendarstellung", ;
		panes.Pane4.HelpContextID = 201410, ;
...
		panes.Top = 28, ;
		panes.Width = 198, ;
...
		*< END OBJECT: ClassLib="..\lib\themedcontrols.vcx" BaseClass="container" />

Best regards
JochenKauz

Disable/Show [Language]-Version of Autogenerated Warning

Is there a way to only display the "Autogenerated" warning in your set language / disable it?

I mean this:

*--------------------------------------------------------------------------------------------------------------------------------------------------------
* (ES) AUTOGENERADO - ¡¡ATENCIÓN!! - ¡¡NO PENSADO PARA EJECUTAR!! USAR SOLAMENTE PARA INTEGRAR CAMBIOS Y ALMACENAR CON HERRAMIENTAS SCM!!
* (EN) AUTOGENERATED - ATTENTION!! - NOT INTENDED FOR EXECUTION!! USE ONLY FOR MERGING CHANGES AND STORING WITH SCM TOOLS!!
*--------------------------------------------------------------------------------------------------------------------------------------------------------

Something like this would be great:

generatewarning: (auto) && uses Language-Option
generatewarning: (off)  && does not display warning
generatewarning: EN     && Display in English

Creating binary files with lower case extensions

Is it possible to to create binary files where extensions PJX, SCX, VCX etc. are forced to be in lower case?
Now I have differences, because regenerated binary files have file extensions in upper case:
picture_2
picture_1
Maybe is there already some parameter for this?

Reports not round-tripping when object's control source has double quotes in source field.

I have a report (.frx) that has a picture/OLE object with the control source set as:

["]+alltrim(oapp.customformpics) + tmpprint.cfd_pictname+["]

screenshot - 2016-07-10 3_13_07 pm

The initial output from BIN2PRG in the corresponding .fr2 file is:

<Reportes 
    platform="WINDOWS " uniqueid="" timestamp="0" objtype="17" objcode="0" name="["]+alltrim(oapp.customformpics) + tmpprint.cfd_pictname+["]" vpos="12916.667" hpos="23854.167" height="17187.500" width="32500.000" order="" unique=".F." environ=".F." boxchar=" " fillchar=" " pengreen="0" penblue="0" fillred="0" fillgreen="0" fillblue="0" pensize="0" penpat="0" fillpat="0" fontface="" fontstyle="0" fontsize="0" mode="1" ruler="0" rulerlines="0" grid=".F." gridv="0" gridh="0" float=".T." stretch=".F." stretchtop=".F." top=".F." bottom=".F." suptype="0" suprest="0" norepeat=".T." resetrpt="0" pagebreak=".F." colbreak=".F." resetpage=".F." general="1" spacing="0" double=".F." swapheader=".F." swapfooter=".F." ejectbefor=".F." ejectafter=".F." plain=".F." summary=".F." addalias=".F." offset="2" topmargin="0" botmargin="0" totaltype="0" resettotal="0" resoid="0" curpos=".T." supalways=".T." supovflow=".F." suprpcol="3" supgroup="0" supvalchng=".F." 
    <picture><![CDATA[]]>
    <tag><![CDATA[]]>
    <tag2><![CDATA[]]>
    <penred><![CDATA[0]]>
    <style><![CDATA[]]>
    <expr><![CDATA[]]>
    <supexpr><![CDATA[cfd_type = 'Picture']]>
    <comment><![CDATA[]]>
    <user><![CDATA[]]>

But when this is imported ran through PRG2BIN, everything is lost from the initial double quotes and on:

screenshot - 2016-07-10 3_20_03 pm

And when exported again through BIN2PRG you get this:

<Reportes 
    platform="WINDOWS " uniqueid="" timestamp="0" objtype="17" objcode="0" name="[" vpos="12916.667" hpos="23854.167" height="17187.500" width="32500.000" order="" unique=".F." environ=".F." boxchar=" " fillchar=" " pengreen="0" penblue="0" fillred="0" fillgreen="0" fillblue="0" pensize="0" penpat="0" fillpat="0" fontface="" fontstyle="0" fontsize="0" mode="1" ruler="0" rulerlines="0" grid=".F." gridv="0" gridh="0" float=".T." stretch=".F." stretchtop=".F." top=".F." bottom=".F." suptype="0" suprest="0" norepeat=".T." resetrpt="0" pagebreak=".F." colbreak=".F." resetpage=".F." general="1" spacing="0" double=".F." swapheader=".F." swapfooter=".F." ejectbefor=".F." ejectafter=".F." plain=".F." summary=".F." addalias=".F." offset="2" topmargin="0" botmargin="0" totaltype="0" resettotal="0" resoid="0" curpos=".T." supalways=".T." supovflow=".F." suprpcol="3" supgroup="0" supvalchng=".F." 
    <picture><![CDATA[]]>
    <tag><![CDATA[]]>
    <tag2><![CDATA[]]>
    <penred><![CDATA[0]]>
    <style><![CDATA[]]>
    <expr><![CDATA[]]>
    <supexpr><![CDATA[cfd_type = 'Picture']]>
    <comment><![CDATA[]]>
    <user><![CDATA[]]>
</Reportes>

Things like quotes " and ' and angle brackets <> should be escaped in XML and then unescaped when reading it back in. This would resolve the above issue:

<   &lt;
>   &gt;
"   &quot;
'   &apos;
&   &amp;

Is tcDontShowErrors effective?

I'm calling FoxBin2Prg on DBFs like
DO C:\DEV\FOX\FOXBIN2PRG\FOXBIN2PRG.PRG WITH <tableName>, "BIN2PRG", "D", .T., .T., .T., .T.

I want it to be completely silent. No progress, no errors. Despite this I still get a messageBox when there's an error letting me know there's an error, and it attempts to open the error log in Notepad. What am I doing wrong?

FoxBin2PRG not ignoring obsolete records

It appears that the Class Designer does not always remove records from the VCX for controls that were deleted in a class. For example, in the attached Test.zip, open the PanelTextFormat class in FRXPanels.vcx and you will see this:

paneltextformatoriginal

However, if you USE FRXPANELS.VCX and BROWSE FOR OBJNAME = 'paneltextformat' OR PARENT = 'paneltextformat', you will find some records that belong to the class that you do not see in the Class Designer: records for objects named Shp1, previewText, LBL1, Lbl4, Lbl2, ad Lbl3. These all have RECNO() values less than the record for the class itself (record 400). Somehow, the Class Designer knows to ignore the extra records (I am guessing it ignores records with RECNO() less than the class record's RECNO).

The problem comes up when you use FoxBin2PRG to convert the VCX to a VC2 file and then from the VC2 to a VCX: when you edit the class, it looks like this in the Class Designer:

paneltextformatafterconversion

The objects with arrows are the extra records from the VCX.

So, FoxBin2PRG needs to ignore obsolete records. I looked for a link between the class record and the object records but it appears to be just on PARENT containing the class name. So, FoxBin2PRG will likely have to do what I think the Class Designer does: ignore records with RECNO() less than the class RECNO().

Test.zip

MNX examples faulty

ℹ Computer information

  • VFP version: VFP9SP2
  • FoxBin2PRG version: 1.19.64
  • Last FoxBin2PRG version w/o bug (if available): n/a

📝 Provide detailed reproduction steps (if any)

  1. Running MPR from example on TESTS\DATOS_READONLY\*.mnx

✔️ Expected result

Should run

❌ Actual result

Does not run

  • use of && in strings
  • non numbers in BAR #

config file generation on EXE from commandline

ℹ Computer information

  • VFP version: VFP9 SP2
  • FoxBin2PRG version: 1.19.64

📝 Provide detailed reproduction steps (if any)

  1. run FoxBin2Prg.exe from commandline using -cCt option

✔️ Expected result

Should create config file

❌ Actual result

Config file not created

Additional information

VFP_.Exe ignore -cCt parameters for internal operation, those parameters are not handed to main program.

This is an internal reminder.

Auto incrementing fields when importing data cause error

I'm trying the new configuration option DBF_Conversion_Support: 8 and I get the following error on importing db2 files for most of my tables:

Error 2088, Field ICONPK is read-only

The field name varies, but it appears that I get the error on the auto incrementing fields and there is data to import:

<Autoinc_Nextval>1</Autoinc_Nextval>
<Autoinc_Step>1</Autoinc_Step>

It would probably be best to create the table without auto incrementing, then turn it back on after any data is inserted. Using the greater of the highest inserted value for that column or the saved Autoinc_Nextval (because of the configuration parameter: ExcludeDBFAutoincNextval).

ALTER TABLE connects ALTER iconpk I AUTOINC NEXTVALUE 45

Last bar in menu files are in some situations not converted correctly back in the mnx file.

ℹ Computer information

  • VFP version: 9.0 sp2
  • FoxBin2PRG version: 1.19.69

📝 Provide detailed reproduction steps (if any)

Last bar in menu files are in some situations not converted correctly back in the mnx file.
See sample mn2 file. The bar close_pos is not correct in converted mnx file objcode is not set.
I fix the problem by adding following line

loReg.OBJCODE	= C_OBJCODE_MENUOPTION_BARNUM	 in otherwise 

In code:
Do Case
Case Left ( m.lcBarName, 1 ) = '"'
	lcBarName   	= Substr( m.lcBarName, 2, Len( m.lcBarName ) - 2 )
	loReg.Name		= m.lcBarName
	loReg.OBJCODE	= C_OBJCODE_MENUOPTION_BARNUM
Case Isdigit( m.lcBarName )
*-- Bar#
	loReg.OBJCODE	= C_OBJCODE_MENUOPTION_BARNUM

Otherwise
*-- Es un BAR del sistema
	loReg.Name	= m.lcBarName
	
* this line to add by issue #79
	 loReg.OBJCODE	= C_OBJCODE_MENUOPTION_BARNUM	&& Bar#_
* /this line to add by issue #79

Endcase

✔️ Expected result

MNX with bar close_pos with objcode set correct

❌ Actual result

MNX with bar close_pos with objcode = 0

📷 Screenshots

PID_MEN.zip

Edit 1 lscheffler:

Formatted code, added correct version number

Edit 2 lscheffler:

Commented code inserted

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.