Different behaviour from VO to X#

This forum is meant for questions and discussions about the X# language and tools
Post Reply
User avatar
AlessandroV
Posts: 88
Joined: Tue Oct 31, 2017 9:07 am
Location: Italy

Different behaviour from VO to X#

Post 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
Attachments
Image1.jpg
Image1.jpg (36.25 KiB) Viewed 882 times
Image2.jpg
Image2.jpg (46.5 KiB) Viewed 882 times
User avatar
AlessandroV
Posts: 88
Joined: Tue Oct 31, 2017 9:07 am
Location: Italy

Different behaviour from VO to X#

Post 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
User avatar
AlessandroV
Posts: 88
Joined: Tue Oct 31, 2017 9:07 am
Location: Italy

Different behaviour from VO to X#

Post by AlessandroV »

Sorry this is a different behavior from SQL return from VO and X#.

Thanks
User avatar
robert
Posts: 4555
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Different behaviour from VO to X#

Post 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
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
AlessandroV
Posts: 88
Joined: Tue Oct 31, 2017 9:07 am
Location: Italy

Different behaviour from VO to X#

Post 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
User avatar
wriedmann
Posts: 3775
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Different behaviour from VO to X#

Post 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
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Post Reply