Break only when Debugging

This forum is meant for questions and discussions about the X# language and tools
Frank Müßner
Posts: 280
Joined: Sat Dec 12, 2015 2:22 pm
Location: Germany

Break only when Debugging

Post 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
FFF
Posts: 1580
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

Break only when Debugging

Post 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
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
Frank Müßner
Posts: 280
Joined: Sat Dec 12, 2015 2:22 pm
Location: Germany

Break only when Debugging

Post 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
User avatar
robert
Posts: 4520
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Break only when Debugging

Post 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
XSharp Development Team
The Netherlands
robert@xsharp.eu
FFF
Posts: 1580
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

Break only when Debugging

Post 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
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
User avatar
Chris
Posts: 4906
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Break only when Debugging

Post 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
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
FFF
Posts: 1580
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

Break only when Debugging

Post by FFF »

Chris,
FTR, after setting "Break always" i see Frank's exeption dlg, too. ;)
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
Frank Müßner
Posts: 280
Joined: Sat Dec 12, 2015 2:22 pm
Location: Germany

Break only when Debugging

Post 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
Frank Müßner
Posts: 280
Joined: Sat Dec 12, 2015 2:22 pm
Location: Germany

Break only when Debugging

Post 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
Attachments

[The extension viaef has been deactivated and can no longer be displayed.]

Frank Müßner
Posts: 280
Joined: Sat Dec 12, 2015 2:22 pm
Location: Germany

Break only when Debugging

Post 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
Attachments

[The extension viaef has been deactivated and can no longer be displayed.]

Post Reply