begin - end sequence compatibility

This forum is meant for questions and discussions about the X# language and tools
Post Reply
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

begin - end sequence compatibility

Post by wriedmann »

Hi,

please see this piece of code:

Code: Select all

local uVal1 as usual
local uVal2 as usual
local uVal3 as usual

begin sequence  
  uVal1 := "Hi"
  uVal2 := 2
  uVal3 := uVal1 + uVal2
end sequence
When executed in VO, it shows a error, as everyone would expect. But since the code error is occuring in a sequence, the program execution will continue.
When this code is executed in X# with the Vulcan runtime, it shows not error, but continues after the end sequence statement.

This will be a major issue for me as I'm using such constructs a lot, leaving the errorhandling to the globally installed error handler.
I understand that .NET does not supports global error handlers, but IMHO the compiler should try to insert something like a error handler in the own runtime, and execute it in such cases.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
Chris
Posts: 4898
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

begin - end sequence compatibility

Post by Chris »

Hi Wolfgang,

So you would like something like the compiler (optionally of course!) automatically inserting a RECOVER USING block (if you have not supplied one) which displays an error message with info about the exception? I think that's doable.

But there's not much that this can do, apart from displaying the error message and have a Continue and an Abort option. Continue would continue execution after the END SEQUENCE (just like it does now), and Abort would terminate the app. Is this what you are looking for?

Chris
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

begin - end sequence compatibility

Post by wriedmann »

Hi Chris,

yes, this would be the best option. But it should be a compiler option.

Thank you very much!

Wolfgang

P.S. Today I have made another big step forward with my VO migration - I have solved an issue with the ADS SQL data access. This error was hidden by the begin - end sequence, but now it is solved.
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Post Reply