Project

General

Profile

Bug #36

TH3: Unable to find packages from DataFlex version

Added by Wil van Antwerpen about 7 years ago. Updated about 7 years ago.

Status:
In Progress
Priority:
Normal
Category:
-
Start date:
03/28/2017
Due date:
% Done:

0%


Description

Hammer3.src isn’t able to open packages from the workspace and will show DataFlex framework files as "not found" in the file explorer.

It is due to this bit in Hammer.src:

// This Procedure should no longer be neccessary.
// MK 27.06.2001 21:41
Procedure IncludeMakePath
String sMake sMake2 sOpenPath
Get_Attribute DF_OPEN_PATH To sOpenPath
Get_Profile_String "DFCOMP" "MakePath" To sMake
Get_Profile_String "WorkSpaces" "SystemMakePath" To sMake2
Set_Attribute DF_OPEN_PATH To (sOpenPath+";"+sMake+";"+sMake2)
End_Procedure
Send IncludeMakePath

The comment there wasn’t helping. The code is not that great either (various reasons)
The code that tries to find the file location is in parser.pkg:

Procedure onNewUsedFile Integer wP Integer lP
Integer iRet
String sName2
Local_Buffer sName pName (lP+1)
Move (CopyMemory(pName,wP,lP)) To iRet
Move (CString(sName)) To sName
If Not "." In sName Append sName ".Pkg"
Get FindFileForWorkspace of ghoWorkspaceHandlerEx sName To sName2
....

Which then goes here: (snipped)

Function FindFileForWorkspace String sFile Returns String
Boolean bExists
String sFileName
String sPaths
String sPath

   // First check df_open_path, this will include files in the runtime pkg folder
   // and base workspace folders
   Get_File_Path sFile     to sFileName

....

It is the Get_File_Path command not knowing about the pkg folder.

Now if you add the following code in the Hammer3.src like so:

Use Tools\TH3Workspace.pkg

// This Procedure should no longer be neccessary.
// MK 27.06.2001 21:41

Procedure IncludeMakePath
String sMake sMake2 sOpenPath
Get_Attribute DF_OPEN_PATH To sOpenPath
Get_Profile_String "DFCOMP" "MakePath" To sMake
Get_Profile_String "WorkSpaces" "SystemMakePath" To sMake2
Set_Attribute DF_OPEN_PATH To (sOpenPath+";"+sMake+";"+sMake2)
End_Procedure
Send IncludeMakePath

Use cWorkSpaceHandlerEx.pkg // Workspace handler (needs to be at the top)

Then now your files are found.
Of course “Get_Profile_String” is obsolete.
Besides that the only files from the pkg folder it will add are those from one of the makepaths and that makepath is not version specific.
This explains WHY the hammer2 sometimes displayed the pkg files from the wrong VDF/DF version.

History

#1 Updated by Wil van Antwerpen about 7 years ago

While the above patch did help for finding the pkg folder, it had side effects.
Btrieve datafiles could no longer be opened.
Most likely because there's a lot of double paths in there and the total path gets too long.
IIRC then DF_PATH cannot be longer as 480 characters total.
So we will have to remove any duplicates.

Also available in: Atom PDF