SetOrder(0) method problem

Public support forum for peer to peer support with related to the Visual Objects and Vulcan.NET products
Post Reply
dododo01
Posts: 10
Joined: Thu Jan 18, 2024 9:23 am
Location: FRANCE

SetOrder(0) method problem

Post by dododo01 »

Hi,

I migrated a VO application to X#.
in a class I opened a DBserver with 8 indexes.
The setOrder method works fine for all 8 indexes, but returns false when I perform a setOrder(0) sequential order.

nOrder := oControl:Value
IF !SELF:Server:setorder(nOrder)
Message("E", "", "Unable to select "+vOrder)
RETURN
ENDIF

Has anyone encountered this before?
thanks.
User avatar
Chris
Posts: 4906
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Re: SetOrder(0) method problem

Post by Chris »

Hi Dominique,

That should normally work. What index are you using, CDX or NTX? Is this the only dbf that doesn't work correctly, or is it with all dbfs?
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
dododo01
Posts: 10
Joined: Thu Jan 18, 2024 9:23 am
Location: FRANCE

Re: SetOrder(0) method problem

Post by dododo01 »

Hi Chris,

I use ntx.
the problem occurs on others dbf files.
User avatar
Chris
Posts: 4906
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Re: SetOrder(0) method problem

Post by Chris »

Hi Dominique,

Thanks, I was testing with CDX before where it works well, but I do see the problem with NTX.

Will open a report for it to be fixed, but for now I think you can ignore the FALSE return value for SetOrder(0), it seems that the natural order is actually getting selected correctly.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
Cyril
Posts: 8
Joined: Wed Sep 13, 2023 7:16 am
Location: France

Re: SetOrder(0) method problem

Post by Cyril »

Hi Chris

I think we have some others problems with NTX index.
Zap function and Reindex function don't perform correctly.

For example the following code:

Code: Select all

	LOCAL oDB AS DbServer
	LOCAL oMes AS warningbox
	
	oDB := DBserver{"C:\Temp\testIndex\EXPLOIT_Test_Zap.DBF", FALSE, FALSE, "DBFNTX"}
	oDB:SetIndex("C:\Temp\testIndex\EXPLOIT_Test_Zap.NTX")
	
	oMes := warningbox{,"Message", "NTX : Count before Zap = " + Str(oDB:Count())}
	oMes:show()	

	oDB:Zap()
	oMes := warningbox{,"Message", "NTX : Count after Zap = " + Str(oDB:Count())}
	oMes:show()	                                     
	
	oDB:Append()
	oDB:FIELDPUT(#CLEF, "GX003")
	oDB:FIELDPUT(#CHEMIN_exe,"Test")
	oMes := warningbox{,"Message", "NTX : Count after Append = " + Str(oDB:Count())}
	oMes:show()
	
	oDB:Reindex()
	oMes := warningbox{,"Message", "NTX : Count after Reindex = " + Str(oDB:Count())}
	oMes:show()
	
	oDB:CreateIndex("C:\Temp\testIndex\EXPLOIT_Test_Zap.NTX", "substr(clef,3,3)")
	oMes := warningbox{,"Message", "NTX : Count after CreateIndex = " + Str(oDB:Count())}
	oMes:show()
	
	oDB:Close()

	oDB := DBserver{"C:\Temp\testIndex\EXPLOIT_Test_Zap.DBF", FALSE, FALSE, "DBFCDX"}
	oDB:SetIndex("C:\Temp\testIndex\EXPLOIT_Test_Zap.CDX")
	
	oMes := warningbox{,"Message", "CDX : Count before Zap = " + Str(oDB:Count())}
	oMes:show()	

	oDB:Zap()
	oMes := warningbox{,"Message", "CDX : Count after Zap = " + Str(oDB:Count())}
	oMes:show()	                                     
	
	oDB:Append()
	oDB:FIELDPUT(#CLEF, "GX003")
	oDB:FIELDPUT(#CHEMIN_exe,"Test")
	oMes := warningbox{,"Message", "CDX : Count after Append = " + Str(oDB:Count())}
	oMes:show()
	
	oDB:Reindex()
	oMes := warningbox{,"Message", "CDX : Count after Reindex = " + Str(oDB:Count())}
	oMes:show()
	
	oDB:CreateIndex("C:\Temp\testIndex\EXPLOIT_Test_Zap.CDX", "substr(clef,3,3)")
	oMes := warningbox{,"Message", "CDX : Count after CreateIndex = " + Str(oDB:Count())}
	oMes:show()
	
	oDB:Close()

Is it possible to fix this 2 issues and have you a method to convert simply NTX DBF to CDX DBF ?

Thank you
Cyril
User avatar
Chris
Posts: 4906
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Re: SetOrder(0) method problem

Post by Chris »

Hi Cyril,

The Zap problem was reported again some days ago and is already fixed, the fix will be included in the next X# release.
We were not aware of a problem with Reindex though, does this only happen after the Zap? If yes, then probably the Zap fix takes care of that, too.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
Cyril
Posts: 8
Joined: Wed Sep 13, 2023 7:16 am
Location: France

Re: SetOrder(0) method problem

Post by Cyril »

Thank you Chris

Yes Reindex problem append after zap. I'll test with the next release

Cyril
Post Reply