xsharp.eu • first test in 2.8 high priority! All the fields values have the same value:false
Page 1 of 1

first test in 2.8 high priority! All the fields values have the same value:false

Posted: Thu Apr 29, 2021 2:50 pm
by jpmoschi
good morning for me, forum:
A simple error beginning the test of the 2.8 review. May by, it is a project setting option?

my code say
local lseleant := select()

The error is 'Select()' threw an exception of type 'System.ArgumentException'
Data: {System.Collections.ListDictionaryInternal}
HResult: -2147024809
HelpLink: null
InnerException: null
Message: "El valor no está dentro del intervalo esperado."
ParamName: null
Source: "XSharp.RT"
StackTrace: " at XSharp.RT.Functions._SelectFoxPro(__Usual[] Xs$Args)
at XSharp.RT.Functions.Select(__Usual[] Xs$Args)"
TargetSite: {XSharp.__Usual _SelectFoxPro(XSharp.__Usual[])}
XSharp.RT.Select()
error CS0234: The type or namespace name 'Select' does not exist in the namespace 'XSharp.RT' (are you missing an assembly reference?)


Is it a setting option?
thanks in advance

Juan

first test in 2.8

Posted: Thu Apr 29, 2021 7:51 pm
by robert
Juan,
Will look at this asap.
This looks like a bug to me.

Robert

first test in 2.8 high priority! All the fields values have the same value:false

Posted: Fri Apr 30, 2021 6:17 pm
by jpmoschi
ok, it is not important because i can replace Select() with DBGetSelect() without alotof work

but it is really important. The query below execute correctly but all the fields values have the same value:false

if SqlExec(1 , "select m03codoper, m03vigente from m03oper","w03oper")= 1
?Evaluate("m03codoper")
False ( Logic )
Value: FALSE

?Evaluate("m03vigente")
False ( Logic )
Value: FALSE

endif
And in whatch window apparently is correct. It should be clarified that the data types of the fields are M03CODEOPER Char(8) and M03VIGENTE Char(1)

XSharp.RDD.DataSession.Sessions {XSharp.RDD.DataSession[1]} XSharp.RDD.DataSession[]
[0] Global datasession Id: 1 XSharp.RDD.DataSession
CurrentWorkarea DBFVFPSQL (W03OPER) XSharp.RDD.IRdd {XSharp.RDD.DBFVFPSQL}
CurrentWorkareaNO 1 Dword
Id 1 Int
Name "Global datasession" String

first test in 2.8 high priority! All the fields values have the same value:false

Posted: Mon May 03, 2021 2:06 pm
by robert
Juan Pablo,
The evaluate() function uses the macro compiler to evaluate the expression. The macro compiler does not know if the string that you are passing it is a field, local variable, public variable or private variable. This makes it a relatively expensive operation. And apparently (I did not check this) it also fails to resolve this correctly.

Can you try:

Code: Select all

?Evaluate("w03oper.m03codoper")   // Cursor DOT FieldName
?Evaluate("w03oper->m03codoper")   // Cursor ALIAS operator FieldName
These 2 also use the macro compiler
And what is the result if you code:

Code: Select all

? w03oper.m03codoper
or

Code: Select all

? FieldGetAlias("w03oper", "m03codoper")

or

Code: Select all

? FieldGetSym("m03codoper")

Robert

first test in 2.8 high priority! All the fields values have the same value:false

Posted: Mon May 03, 2021 3:43 pm
by jpmoschi
hi Robert . The Evaluate() was only used in inmediate window. The screen capture attached is more clear to show the problem.
i create a new Console App
Then run and watch ...

first test in 2.8 high priority! All the fields values have the same value:false

Posted: Mon May 03, 2021 3:50 pm
by jpmoschi
I know what is happening. The sqlexec return the result but the record pointer is in eof() in the new 2.8. release