2.6a vs 2.8 Index creation problem. Why?

This forum is meant for questions about the Visual FoxPro Language support in X#.

Post Reply
jpmoschi
Posts: 76
Joined: Thu May 21, 2020 3:45 pm

2.6a vs 2.8 Index creation problem. Why?

Post 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.
User avatar
Chris
Posts: 4562
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

2.6a vs 2.8 Index creation problem. Why?

Post 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?
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
User avatar
Chris
Posts: 4562
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

2.6a vs 2.8 Index creation problem. Why?

Post 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
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
Post Reply