PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → Analysis problems
Analysis problems
Débuté par GuenterP, 23 juil. 2017 19:03 - 5 réponses
Posté le 23 juillet 2017 - 19:03
Hi,

this is just an info what can happen to an analysis. I know how to fix that - making a new analysis and copy the files from the old one and re-arrange files and links. It will just waste some time, at least two days.

There is an analysis with 64 files and 76 links. Not a big thing. This analysis has been tweaked and changed hundreds of times. And now I deleted a single file ("ANFAHRT") and all references to it in the associated program.

Among many other things, in the project's initialization code there is a simple loop to detect and HCreation(..) missing files in the target database:
MyString = HListFile("MyProject.wdd","",hLstNormal)+CR MyLocalI = StringCount(MyString,CR) FOR MyLocalA = 1 TO MyLocalI MyFileName = ExtractString(MyString, MyLocalA, CR) IF NOT HFileExist(MyFileName) THEN HCreation(MyFileName) END END
And now HCreation(MyFileName) throws an error and says, that the deleted file is not in the analysis!

Means: HListFile(..) is able to see and include the deleted file name in MyString, but HCreation(..) is not able to create the file, because it has no info about the file.

Quick solution: I just created a file with the same name and a single item "dummy" in it. When restructuring the file, WD22 complains about a duplicate file name, but it works. I tried to remove / recreate this file for several times but the error stays. So I left it alone and it works for the time being.

Btw. I became a bit skeptical about the file system and could locate two links in the Link-List of the HF-CC which pointed to non-existing (= deleted) files!
Posté le 23 juillet 2017 - 19:28
Hi AL,

some years ago, we had a lot of mails between Tech Support and myself going forth and back. A number of experiments showed that HCreationIfNotFound(..) is rather (very) slow and does not return enough info about errors. HCreation(..) is the only function which gives you full info about any errors and is a lot faster than HCreationIfNoTFound(..).
Posté le 23 juillet 2017 - 19:44
Hello Geunter

Yes, I agree with you about HCreationIfNotFound() being slow.
I was referring to the option in the"Files" section of the project description that offers to automatically create the data files if they are not found when they are first opened.
I always thought that was PCSoft's answer to the slow HCreationIfNotFound()

Regards
Al
Posté le 23 juillet 2017 - 20:01
Hello Guenter

I am wondering if the autocreate files option in the project setup would have created the missing file and also why you do the HCreation manually rather than use the project setup option. Have you had a problem with it in the past ?

Regards
Al
Posté le 24 juillet 2017 - 10:21
Hi Guenter,

the same thing happened to me in v19 (or v17).
According to support the Analysis was "corrupted" and since "Repair the analysis" didn't fix it, I used the technique you described to create a new analysis.

Since I didn't see the problem in v20 or v21 I thought that PCSoft had fixed it, but here we go again ...

Steven Sitas
www.alpha360.biz
Posté le 26 juillet 2017 - 08:34
Hi Steven,

firstly some good news! I wanted to send the "damaged" analysis to PCS Tech Support. Created a new Project without database, copied the \MyProject.ana directory to the new project's directory, connected the analysis to the project, deleted the ANFAHRT file from the analysis, generated the analyis and ho and belo! the file was really gone and not requested from my small HCreation(..) FOR-TO-loop in the Project Code!

Conclusion: there must be some other .wdd file which influences the bahaviour of the program.

1 - I deleted the .cpl directory which more often than not causes interference with the program. No change!

2 - Changed the reference to the directory of the .wdd file
IF InTestMode(tmProject) THEN MyString = HListFile("C:\My Projects\BackComfort\BackComfort.ana\BackComfort.wdd","",hLstNormal)+CR ELSE MyString = HListFile("BackComfort.wdd","",hLstNormal)+CR // <<== the problem! END
Now it works just fine!

What can we learn?

In a project and after some time, there are numerous .wdd, .wda, .wdp, .wdap files to be found in the project's directory. Seems that there is a hidden program error somewhere in the depths of WINDEV that does not reference to the analysis' directory while running the GO but looks somewhere else! For a compiled program just take care to include the newest .wda, .wdd .. files before compiling for deployment!