Welcome! Log In Create A New Profile

Advanced

Data versioning

Posted by Steve DD.pcs.crosspost 
Steve DD.pcs.crosspost
Data versioning
July 14, 2008 03:06PM
I'm looking for a way to identify the version of data used by an application using only the application's data folder that contains the HF files.

ApplicationFolder\Application.WDD
ApplicationFolder\Application.REP
ApplicationFolder\DataFolder\*.FIC

I understand the HF files used by an application contain an AnalysisGUID and GenerationNumber property.

However, this value does not change when generating a new analysis (ie change in data structures) and applying it to the application's HF files.
Only the GenerationNumber of the analysis (wda file, not wdd) changes, and the GenerationNumber of the files that were modified.

Is there a built-in way to uniquely identify the version of the analysis used by the HF files of an application supplying only the data folder containing the FIC files?

I'm aware that I can setup a versioning system of my own for future updates but would like to know if there is a built-in procedure for this.

Message forwarded from pcsoft.us.windev
GuenterP
Re: Data versioning
July 14, 2008 05:56PM
Hi Steve,

this is an old, old problem!! No solution yet, no one seems to care! Seems.

* Each file in the analysis has a generation number
* Each HypeFile data file has a generation number too. (MyFileName..GenerationNumber)

A - There is no way to retrieve the Analysis Generation Number of a file from the analysis.
B - Bad enough, but in perfectly running real world applications, the Analysis Generation Number CAN differ from the File Generation Number !! This doesn't happen very often, but it happens.

While A appears to be deplorable, B explains why you will not get a WinDev command for retrieving the analysis generation number. If you could retrieve the analysis generation number and compare it to the file generation number in some cases inevitably your program would find a difference and you'd try to solve it by running wdmodfic. However, this would happen each time a user starts the application, because wdmodfic wouldn't find any upgrade to be done and leave the data file as it is.

Bottom line: currently, there is no easy way to find out whether the application or the data files are newer or older. You just can identify a difference by judging the result (error codes) from the HOpen(..) command. You know that there's a difference but you cannot know which action to take.

This is a code snippet of the 'version-test' I'm doing in some of my applications. It had been much more extensive before but because of B I had to do away with all of the more sophisticated stuff. It's self-explaining, so I diddn't do a translation from German ..

	// 3 - Open der Dateien mit spezieller Beachtung des Index und der Struktur
	MyY = 0; MyZ = 0; MyString3 = ""
	ErgebnisString = HListFile("","",hLstNormal)+CR
	FOR I = 1 TO StringCount(ErgebnisString,CR)
		MyFile = ExtractString(ErgebnisString,I,CR)
		IF Left(MyFile,2) = "BS" THEN
			WHEN EXCEPTION IN
				HOpen(MyFile)
			DO
				// Die Datei hat ein Problem
				MyZ++; MyString3 += MyFile+"  Fehler: "+NumToString(HError(hErrCurrent))
				IF HError() = 70021 OR HError() = 70052 THEN HIndex(MyFile,hNdxSilent)
				IF HError() = 70003 THEN HCreation(MyFile)
				IF HError() = 70016 THEN Info("Datei: "+MyFile,"Fehler 70016 aufgetreten !")
			END
		END	
	END

Kind regards,
Guenter

Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: