xsharp.eu • Break only when Debugging
Page 1 of 4

Break only when Debugging

Posted: Fri Nov 02, 2018 11:31 am
by Frank Müßner
Hello,
I try some new code with X# without Vulcan DLL and have a Question.

I use XIDE 1.15 and X# Compiler version 2.0.0.6

this Code:

LOCAL c AS STRING
LOCAL d AS DATE

c:=DToC(today())
d:=CToD(" . . ")
d:=CToD(NULL_STRING)
d:=Null_date

I get no error when run start the Application. When Debug i get:

at this line:

d:=CToD(" . . ") --->>> System.FormatException Die Eingabezeichenfolge hat das falsche Format.

My Question is, why not show the Error when Run the App? Perhaps Settings in Xide?

Why CToD(" . . ") work with VO and not X#

Regards Frank

Break only when Debugging

Posted: Fri Nov 02, 2018 1:15 pm
by FFF
Frank,
copied your lines, then
FUNCTION Start( ) AS VOID
LOCAL uXSharpUsual AS USUAL
uXSharpUsual := "Hello X# runtime!"
System.Console.WriteLine(AsString(uXSharpUsual))
LOCAL c AS STRING
LOCAL d AS DATE

c:=DToC(Today())
d:=CToD(" . . ")
d:=CToD(NULL_STRING)
? d:=Null_date
RETURN

Runs, as for you.
When debugging i have to switch to x86mode, then i can walk through all lines without a hitch.

Karl @W8.1/64, Xide 1.15 & X#2.0.0.6

Break only when Debugging

Posted: Fri Nov 02, 2018 1:48 pm
by Frank Müßner
Hi Karl,

i have all compile with X86. :-)

CToD(" . . ") is only a sample that i found.

There is other Code that run without Error, but when debug the error is shown. That is my Problem.

Frank

Break only when Debugging

Posted: Fri Nov 02, 2018 1:50 pm
by robert
Frank,
Did you enable the option to break on "any exception". I can imagine that there is an exception inside the runtime (because we have not handled the empty date properly) but the result of the CTOD should still be a NULL_DATE. There is a TRY CATCH in the runtime that guarantees that the empty date is returned.
That would also explain why the code works "as expected" for Karl.

Robert

Break only when Debugging

Posted: Fri Nov 02, 2018 2:06 pm
by FFF
Frank,
i wrote i CAN DEBUG through all of the shown code. Make an X#runtime new app, copy my code in, set a breakpoint in the "today"line and Shift F5. Works or no?
There's no chance to verify problems, if there are no concise descriptions of what you are doing exactly...

Karl

Break only when Debugging

Posted: Fri Nov 02, 2018 3:59 pm
by Chris
Hi Frank,

Most probably it's what Robert said, it is a harmless exception that happens inside the rutnime code and is being properly handled by our code. Please check the caption of the dialog that is shown when the exception is intercepted, it says "<exception name> was handled" (not "unhandled"), right?

You can chose to not break on handled exceptions by using form the menu Debug/Unhandled Exceptions->Break Never. And yes, after so many years, I just now realized he caption of this menu item is incorrect :)

Chris

Break only when Debugging

Posted: Fri Nov 02, 2018 4:29 pm
by FFF
Chris,
FTR, after setting "Break always" i see Frank's exeption dlg, too. ;)

Break only when Debugging

Posted: Fri Nov 02, 2018 5:06 pm
by Frank Müßner
Hi Chris,
ok i will look for the <exception name> the next time, and will play with the "Debugger Options"

Karl,
i can debug through all the shown code, too. When i have a better Sample where i have noticed this, i will make a sample.

Frank

Break only when Debugging

Posted: Sat Nov 03, 2018 8:51 am
by Frank Müßner
Hello,
Maybe a better example what I mean:


[STAThreadAttribute];
FUNCTION Start( asCmdLine AS STRING[] ) AS INT
LOCAL nExitCode AS INT
LOCAL oMainWindow AS StandardSDIWindow
LOCAL oApp AS App
LOCAL aD AS ARRAY

RDDSetDefault( "DBFCDX" )

nExitCode := 0

oApp := App{}
oMainWindow := StandardSDIWindow{oApp}
oMainWindow:Show(SHOWCENTERED)

AAdd(aD,"Test")

oApp:Exec()

RETURN nExitCode

///////////
XIde XSharp/Dialect VO/X86

this code does not run, naturally because array(AD) is not initialized.
But when 'Run' i get no Error Message.

When Debug i get the right Error Message "System.NullReferenceException"

So i can not see and find any Error :-(

Frank

Break only when Debugging

Posted: Sat Nov 03, 2018 1:19 pm
by Frank Müßner
Hi,
other Sample.
Simple VO App that will open a Datawindow with ArrayServer work in VO. Transport to X# and not work. Call SELF:Use(oServer) (over FileOpen Method in Sample)
Can someone confirm this?

Frank