xsharp.eu • 2.6a vs 2.8 Index creation problem. Why?
Page 1 of 1

2.6a vs 2.8 Index creation problem. Why?

Posted: Tue May 04, 2021 7:17 pm
by jpmoschi
Good morning forum, i have serious problems with the 2.8 revision. I am trying to jump from 2.6a revision but is imposible with this level of errors. The next is a Console Program to expose one of them with a index creation. Before the index creation and DbGoTop() the record pointer is in EOF ignoring the DBGoTop().

Less important but diferent in foxpro, when a record pointer is in eof, It never lose its data type. If a field is char(xx), the value in EOF is space(xx), if a field is numeric, the value in EOF is 0, etc.

Really i need your help
Best regards
Juan



Program.prg

Code: Select all

USING System
USING System.Collections.Generic
USING System.Linq
USING System.Text

FUNCTION Start() AS VOID STRICT
    ? "Hello World! Today is ",Date()
    private _handle
    STORE [code]SqlConnect("MSSQLTEST") to _handle
    LRESULT = SqlExec(_handle , "select m03codoper, m03vigente from m03oper","w03oper")
    DbSelectArea("w03oper")
    ? "After DbCreateIndex", "DbGoTop:", DbGoTop(), "Eof:",Eof() , "RecCount():", RecCount(), "Recno:", RecNo()
    ? w03oper->m03codoper
    ? w03oper->m03vigente
    ?DbCreateIndex("key1",,{|| m03vigente + m03codoper } ,FALSE)
    ? "Before DbCreateIndex", "DbGoTop:", DbGoTop(), "Eof:",Eof() , "RecCount():", RecCount(), "Recno:", RecNo()
    ? w03oper->m03codoper
    ? w03oper->m03vigente
Output

Code: Select all

Hello World! Today is  04/05/2021
After DbCreateIndex DbGoTop: .T. Eof: .F. RecCount(): 5568 Recno: 1
$ 01 BI
N
.T.
Before DbCreateIndex DbGoTop: .T. Eof: .T. RecCount(): 5568 Recno: 5569
.F.   ???  What happend with DbGoTop in prior line ?  End of file value is Logical y a character field? 
.F.

2.6a vs 2.8 Index creation problem. Why?

Posted: Thu May 06, 2021 3:39 pm
by Chris
Hi Juan Pablo,

Thanks for your report, we're looking into it. Just to make sure it's a general problem and not specific to the table/columns you use in this sample, do you get this odd behavior in every case?

2.6a vs 2.8 Index creation problem. Why?

Posted: Fri May 07, 2021 3:42 pm
by Chris
Robert has fixed this problem, it had to do with NULL string values, see here: https://github.com/X-Sharp/XSharpPublic/issues/630