xsharp.eu • Different behaviour from VO to X#
Page 1 of 1

Different behaviour from VO to X#

Posted: Tue Aug 01, 2023 9:29 am
by AlessandroV
Hi to all, i am transporting a big VO APP to X#.
i found an  different behaviour from VO to X# about DATAWINDOW.

This code in VO open the window on shell, in X# not:

            oWnd := Wnd_Acquisisci{SELF,,,Arr}
            oWnd:Show()

SELF is a datawindow owner. Both are datawindow.

In X#, see image 1, the window is mixed with it’s owner.

Same code in VO, i have clicked on button “PDF ed Immagini”, see image 2

Any solution? Or i must change my code?

Bye

Different behaviour from VO to X#

Posted: Tue Aug 01, 2023 10:01 am
by AlessandroV
other different behavior:

I have to create a DBF from Array list. This array list come from a query.
In this query for join effect i have duplicate names like:

abi
abi
abicr
abiweb
accisa
acronimo

2 times abi, In VO this was working, in X# i got an error.

Clear that is an error but in VO code was working. I am currently porting from VO to X# and I don't know how many times in my code I have this case.
How can I fix it? How do you outclass the various DBCreates from the rdd ? In this case I would handle them myself.

Thanks a lot Alessandro

Different behaviour from VO to X#

Posted: Tue Aug 01, 2023 10:06 am
by AlessandroV
Sorry this is a different behavior from SQL return from VO and X#.

Thanks

Different behaviour from VO to X#

Posted: Tue Aug 01, 2023 10:12 am
by robert
Alessando,
I just tried this in VO and it also complains about a duplicate field name:

Code: Select all

FUNCTION Start( )  
LOCAL aStruct AS ARRAY
aStruct := {{"ABC","C",10,0},{"ABC","C",10,0}}
DBCREATE("test",aStruct,"DBFNTX")  // Error:
DBUSEAREA(TRUE,"DBFNTX","test")
? FieldName(1)
? FieldName(2)
DBCLOSEAREA()
WAIT

RETURN NIL
Error message in VO

Code: Select all

Error message:
--------------
Error Code:  1 [ ARGUMENT ERROR ]
Subsystem: DBFNTX
Error Subcode: 1037 (Field name already exists)
Function: DBCREATE
Argument: ABC
If you ignore the error in VO then the code continues but the file is NOT created.

RETURN NIL

Different behaviour from VO to X#

Posted: Tue Aug 01, 2023 10:26 am
by AlessandroV
Hi Robert,
sorry, i didn't realize there was a difference on calculating the DBStruct from SQL. I wrote a post about it right away, see above.

Thank you

Different behaviour from VO to X#

Posted: Tue Aug 01, 2023 12:23 pm
by wriedmann
Hi Alessandro,
di you are sure that you are not changing something in your window subclass?
In VO, if you are using a datawindow a another datawindows owner, the second becomes a subdatawindow of the first one. This is a standard behavior in VO (and it fouled me several times).
I suspect that you are checking somewhere in your code if the owner is a datawindow, and then use the owner of this datawindow.
Wolfgang