User Tools

Site Tools


begin sequence - end sequence

The begin sequence - recover - end sequence statements are widely used in VO applications, and the X# compiler translates it mainly in the try - catch and end try statements. So, if you are transporting VO code, you can keep these statements safely, but for new code please use the .NET equivalents Try - Catch. Where the X# compiler adds functionality in the translation is in the recover statement, to support the VO break command, and encapsulates the exception in an usual. And it adds support for the CanBreak() function. Please see here for a detailled explanation:

The biggest difference between the error handling in .NET and Visual Objects stays in the ErrorBlock() handling. Please see the relative topic: The VO ErrorBlock

The biggest difference is that in VO you can set a global error handler, and this is then called every time a runtime error is encountered, regardless of the presence of a begin sequence - end sequence block.

In .NET, if an exception is occurring, and there is no try - end try block that encapsulates this code, the program is terminated abnormally. If there is such a block, the execution continues in the catch part of this block, and then the program continues to run normally, and if the catch block does not shows any error, you will not see any error message.

Therefore, in X# the presence of error handling is much more important than in VO.

begin_end_sequence.txt · Last modified: 2019/08/29 17:57 by wolfgangriedmann