Falsch sortiert

Deutschsprachiges X#-Forum – German language forum

Moderator: wriedmann

Post Reply
User avatar
Horst
Posts: 336
Joined: Tue Oct 13, 2015 3:27 pm

Falsch sortiert

Post by Horst »

Hallo

Habe ein kleines Problem. Mein Modul um CDX Files neu aufzubauen generiert in einem Fall das CDX File aber die Sortierung ist falsch.

Wen ich mit dbAdmin den Index neu aufbaue stimmt es.

Im Anhang das kleine lauffähige Muster. Hoffe alles ist drin :-)

In VO genau gleich, macht den Index aber die Sortierung stimmt nicht.

Gruss
Horst
Attachments
Index.zip
(7.23 KiB) Downloaded 105 times
Shot.jpg
g.bunzel@domonet.de
Posts: 97
Joined: Tue Mar 01, 2016 11:50 am
Location: Germany

Re: Falsch sortiert

Post by g.bunzel@domonet.de »

Horst,

in VO habe ich diesen Vermerk:

SetAnsi( TRUE ) // after SetNatDLL()!!


Evtl. funktioniert das auch in X#.

HTH

Gerhard
User avatar
Chris
Posts: 4898
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Re: Falsch sortiert

Post by Chris »

Hi Horst,

Can you please explain a bit more on what exactly is wrong with the generated sort order? It seems to be ok here, but I'm probably overlooking something.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
Horst
Posts: 336
Joined: Tue Oct 13, 2015 3:27 pm

Re: Falsch sortiert

Post by Horst »

Hallo Gerhard

Habe es probiert, keine Änderung

Hello Chris

I reduzed the code and i added a second DB to sort.

Code: Select all

  
	cPfad 				:= "c:\XIDE\TMP\"    
	
	// PV_Module
	cFilename 			:= cPfad+"PV_Module"
	FErase 				(String2Psz (cFilename+".cdx")) 

	odbTmp 				:= dbserver {cFilename,FALSE,FALSE,"DBFCDX"}   // ohne DBF
	odbTmp:createorder ("PVMODULE",,"HERSTELLER",{|| _field->HERSTELLER})

	/* ----------------------*/                         

	// Buchtexte
	cFilename 			:= cPfad+"Buchtexte"
	FErase 				(String2Psz (cFilename+".cdx")) 

	odbTmp 				:= dbserver {cFilename,FALSE,FALSE,"DBFCDX"}   // ohne DBF
	odbTmp:createorder ("Buch",,"BESCHRIEB",{|| _field->Beschrieb})
All Files are in the zip file.

Please look on the screenshot (shot2.jpg), there you can see on the left side the DB is not sorted , on the right side its sorted.
I dont know why the DB PV_Module is not sorted. I tryed also a different Field (ModulTyp->shot3.jpg) to sort but doesnt work.
When i say to dbAdmin to recreate the index , it works.

Horst
Attachments
SHOT3.jpg
IndexTest.zip
(154.83 KiB) Downloaded 97 times
SHOT2.jpg
User avatar
Chris
Posts: 4898
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Re: Falsch sortiert

Post by Chris »

Hi Horst,

Thanks, i see the problem now, it's because the field in some of the records (those that appear on top after reindexing) have a few space characters in front of them. For example the "LG SOLAR" field is actually stored in the dbf as " LG SOLAR". If you remove those spaces from the fields, then the order is correct.

I don't know why dbAdmin does not show the spaces in front of the fields in the browser, but if you try to edit the field (from dbAdmin) then you will see them.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
Horst
Posts: 336
Joined: Tue Oct 13, 2015 3:27 pm

Re: Falsch sortiert

Post by Horst »

Hello Chris

Thank you very mutch, i see it now, its a TAB.

Horst
Post Reply