DBServer Difference VO and X#

This forum is meant for questions and discussions about the X# language and tools
Post Reply
HeikoP
Posts: 48
Joined: Mon May 30, 2016 4:19 pm
Location: Germany

DBServer Difference VO and X#

Post by HeikoP »

Hello,

I´m not sure if you want to get this kind of feedback, but I found a litte difference in the behaviour of x# (Version 2.7 from November 2020) and VO2.8 while using the dbserverclass.

FUNCTION foo() AS LOGIC
LOCAL oDB AS dbserver
LOCAL cFilename AS STRING
cFilename:="c:tempmydbf.dbf"
oDB:=DbServer{cFilename,FALSE,FALSE,"DBFCDX"}
oDB:=DbServer{cFilename,FALSE,FALSE,"DBFCDX"}
IF !oDB:Used
* Print some errorcode
RETURN FALSE
ENDIF
oDB:close()
oDB:=null_object
RETURN TRUE

In VO 2.8 this works. In x# this leads to an error. I know it´s not a good code style, but it´s a difference.

Greetings Heiko
User avatar
Chris
Posts: 4907
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

DBServer Difference VO and X#

Post by Chris »

Hi Heiko,

I confirm the incompatibility, in VO when a DBServer cannot be opened due to sharing violation, then no error is reported, just Used returns FALSE, while X# throws an exception. Will take care of this for the next build, thanks for your report!
Chris Pyrgas

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