Hello everyone!
It sems that DBServer:OrderSkipUnique() is not working. I wrote the following code for testing:
METHOD ButtonTest AS VOID PASCAL
LOCAL oDBServer AS DbServer
LOCAL oTB AS TextBox
oDBServer := DbServer{"c:xsharptmppos.dbf", DBSHARED, FALSE, "DBFCDX"}
oDBServer:SetIndex("c:xsharptmppos.cdx")
oDBServer:SetOrder("TischNr")
oDBServer:GoTop()
WHILE !oDBServer:EOF
oTB := TextBox{, "test", NTrim(oDBServer:fieldget("bTischNr")) + CRLF + NTrim(oDBServer:RecNo)}
oTB:Type := BUTTONYESNO
IF oTB:Show() == BOXREPLYNO
EXIT
ENDIF
oDBServer:OrderSkipUnique()
ENDDO
oDBServer:Close()
It allways shows :
-1000
14501
The OrderSkipUnique() function does not appear to be executed.
I recreated the cdx file but it still didn't work.
The .dbf and the .cdx are in the attachments.
Regard
Kai
DBServer:OrderSkipUnique not working?
DBServer:OrderSkipUnique not working?
- Attachments
-
- TMPPOS.zip
- (247.51 KiB) Downloaded 127 times
DBServer:OrderSkipUnique not working?
Kai,
didn't know this method
But what do you expect. After GoTop, your TischNr is "1" - the next TischNr, which is NOT 1, is -1000, and this in record 14501. Behind this record no ofter TischNr exists. So, for my eyes, the result is correct.
BTW, wouldn't hurt to first check with and the provide a sample dbf with a bit less records
didn't know this method
But what do you expect. After GoTop, your TischNr is "1" - the next TischNr, which is NOT 1, is -1000, and this in record 14501. Behind this record no ofter TischNr exists. So, for my eyes, the result is correct.
BTW, wouldn't hurt to first check with and the provide a sample dbf with a bit less records
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
DBServer:OrderSkipUnique not working?
Hi Karl!
Sorry for the large amont of records.
For me after GoTop() bTischNr is -1000 and not 1. The correct ascending order is -1000, -1 since -1000 is less than -1
I Expect:
GoTop() bTischNr = -1000 / EOF = false
First OrderSkipUnique() bTischNr = -1 / EOF = false
Second OrderSkipUnique() EOF = true
In VO it works like this.
Regards
Kai
Sorry for the large amont of records.
For me after GoTop() bTischNr is -1000 and not 1. The correct ascending order is -1000, -1 since -1000 is less than -1
I Expect:
GoTop() bTischNr = -1000 / EOF = false
First OrderSkipUnique() bTischNr = -1 / EOF = false
Second OrderSkipUnique() EOF = true
In VO it works like this.
Regards
Kai
DBServer:OrderSkipUnique not working?
Hi Karl, Kai,
Indeed there's a problem here, OrderSkipUnique() fails to move to the next group of values or to eof if not one is found. Will log this for Robert to look into it and fix it, problem can be also reproduced as such:
.
Indeed there's a problem here, OrderSkipUnique() fails to move to the next group of values or to eof if not one is found. Will log this for Robert to look into it and fix it, problem can be also reproduced as such:
Code: Select all
FUNCTION Start() AS VOID
LOCAL nDirection := NIL AS USUAL
LOCAL cFileName AS STRING
LOCAL n AS INT
cFileName := "c:dbfSkipUnique"
DbCreate(cFileName , {{"FLD","N",5,0}})
FErase(cFileName + ".cdx")
DbUseArea(,"DBFCDX",cFileName)
FOR n := 1 UPTO 10
DbAppend()
FieldPut(1, iif(n%2==0, 1 , 2))
NEXT
DbCreateIndex(cFileName, "FLD")
DbGoTop()
WHILE !Eof()
? FieldGet(1) , RecNo()
VoDbOrderInfo( DBOI_SKIPUNIQUE, "", NIL, REF nDirection )
ENDDO
DbCloseArea()
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
DBServer:OrderSkipUnique not working?
Hi Kai,
sorry for the confusion, you are right, of course. To my defense, i looked in the dbf with a tool, to find out, what's in - so no SetOrder, then stopped thinking...
That's the difference between the gurus like Chris and noobs like me
sorry for the confusion, you are right, of course. To my defense, i looked in the dbf with a tool, to find out, what's in - so no SetOrder, then stopped thinking...
That's the difference between the gurus like Chris and noobs like me
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
DBServer:OrderSkipUnique not working?
It's just the difference that I'm paid money to investigate things like that, so I need to persist and fully investigate what's going on
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
DBServer:OrderSkipUnique not working?
Hi Chris!
Thanks for reporting this issue to Robert.
I found another problem with DBServer:Seek(). The lLast Parameter seems to be ignored. Can you check this please if this issue is not known yet?
Regards
Kai
Thanks for reporting this issue to Robert.
I found another problem with DBServer:Seek(). The lLast Parameter seems to be ignored. Can you check this please if this issue is not known yet?
Regards
Kai
DBServer:OrderSkipUnique not working?
Hi Kai,
.
In a small test case I wrote, this seems to work fine here. Can you please provide a sample showing the problem?Kai post=23743 userid=4500 wrote: I found another problem with DBServer:Seek(). The lLast Parameter seems to be ignored. Can you check this please if this issue is not known yet?
.
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
DBServer:OrderSkipUnique not working?
Hi Chris!
I wanted to make a small example but for some reason it works fine for me now too.
Sorry, I really don't know why? I'll work on it and let you know when I have something new. This morning I tested it several times and it never worked, and the only thing is, that I restarted the computer after lunch.
I wanted to make a small example but for some reason it works fine for me now too.
Sorry, I really don't know why? I'll work on it and let you know when I have something new. This morning I tested it several times and it never worked, and the only thing is, that I restarted the computer after lunch.