This project is read-only.

Twice form save == good view of diffs? Why?

Topics: Bug Information
Jun 30, 2009 at 9:48 AM

Hello everyone,

I`ve been working on some project in VFP and now I have to switch from VSS to SVN - for various reasons. So finally I was redirected to this project. It`s great but (of course) not ideal. Strange behavior occurs not in genXML.app but in FOX. When we do some changes in our FORM and save it, the order of rows in SCX changes (even if we don`t add anything - changes only in methods) - and when we genXML we`ve got xml reshaped -there are more differences than we put (because of another order of rows in SCX). Ok, this is probably 'normal' behavior, but when we open the same form again and do nothing except Ctrl+S we`ve got scx reordered again - this time it is in the order which we have before our changes. So after second save and after genXML we have diffs in good places. Is there any way to avoid twice save or how to fix that?

I`m working on VFP9.0 SP2, 9.00.0000.5815, Windows Vista with all bugfixes (I hope ;-)).

 

Jun 30, 2009 at 1:47 PM

Ok, today I probably have good day ;-). http://fox.wikis.com/wc.dll?Wiki~ZOrderSet this thread gave me a tip... ZOrderSet in memo field "Properties" in the SCX file. ZOrderd is the source of the all evil. I had not unique ZOrderSet properties and they were not sequenced - there was holes in numbering. Solution is: set ZOrderSet to unique in class or form file or delete ZOrderSet row from memo. Today I`ve tested the second method - it works, tommorow I`ll test unique methods.

Jul 1, 2009 at 7:14 PM

Hi,

just as a sidenote:

>> working on VFP9.0 SP2, 9.00.0000.5815, Windows Vista with all bugfixes <<

The current version of VFP9 SP2 is .7423; you're missing the latest hotfixes. (Download here: http://code.msdn.microsoft.com/Project/ProjectDirectory.aspx?TagName=Hotfix&ProjectSearchText=FoxPro )

wOOdy

 

 

Jul 2, 2009 at 6:28 AM

Thanks,

so I think this is it. When I put unique setOrder numbering I`ve got error about other properties. The better way is to cut the ZOrderSet from Properties memo just before first XML generation and COMMIT, and before every XML generation. Maybe someone know is there anything important what is doing the ZOrderSet properties? (except sequence of Init method)

 

Below is code I`ve written for cutting ZOrderSet on whole project files(in vcx scx - haha there are polish-english names on variables):

LPARAMETERS cPjx
LOCAL cVScx, nLines, cCurrentMText, cMText, lBylZOrder
STORE '' TO cMText
STORE '' TO cCurrentMText
STORE .f. TO lBylZOrder
STORE 0 TO nLines
IF NOT EMPTY(cPjx)
	USE &cPjx IN 0
	USE &cPjx again ALIAS Pjx 
	SELECT Pjx
	nDS=SELECT()
	GO top
	SCAN
		IF "scx"$name OR "SCX"$name OR "vcx"$name OR "VCX"$name
			cVScx=name
			SELECT 0
			USE &cVScx again ALIAS Formatka 
			go top
			SCAN
				lBylZOrder= .f.
				nLines=MEMLINES(Properties)
				_MLINE = 0
				cMText=''
				SET MEMOWIDTH TO 253
				for i=0 to nLines
					cCurrentMText=''
					cCurrentMText = MLINE(Properties, 1, _MLINE)
					if not "ZOrderSet" $ cCurrentMText
						cMText=cMText+cCurrentMText+CHR(13)+CHR(10)
					else
						lBylZOrder=.t.
					endif 
				endfor
				if lBylZOrder
					replace Properties with cMText
				endif 
			ENDSCAN
			USE
			SELECT Pjx
		ENDIF 
	ENDSCAN 
	USE 
	
ENDIF 

 

I`m firing it from zorderremover.prg in genxml.prg just before "Creating *.twofox file"

	lcProject = GetFile( "pjx", "Select a project file" )
		If not File(m.lcProject)
			Return
		EndIf 
	EndIf
	*--------------------------------------------------------------------------------------
	* Remove ZOrderSet
	*--------------------------------------------------------------------------------------
	DO zorderremover WITH m.lcProject
	*--------------------------------------------------------------------------------------
	* Create the *.twofox file.
	*--------------------------------------------------------------------------------------
	Local loSplit
	loSplit = NewObject("CSPlitPJX","TwoFox.prg")
	loSplit.Split( m.lcProject )
Maybe there is another cause of changing order of source xml. I`m still waiting for answers :-).