Show/Hide Toolbars

XSharp

Generate code to fully implement the VO compatible BEGIN SEQUENCE .. END SEQUENCE.

The compiler generates calls to the runtime functions _SequenceError and _SequenceRecover that you may override in your own code.

-vo17[+|-]

Arguments

+ | - Specifying +, or just -vo17, tells the compiler to automatically generate constructors with the same signature as the constructors of the parent class

To set this compiler option in the Visual Studio development environment:

 

1.Open the project's Properties page.

2.Click the Dialect tab.

3.Change the value.

4.Click here to see the property page

 

 

The generated code by the compiler will call 2 runtime functions to allow you to adjust the behavior of the BEGIN SEQUENCE .. END SEQUENCE handling.

 

The default implementation of these functions is in the XSharp Runtime:

/// <summary>
/// This function is automatically inserted by the compiler in a RECOVER USING block and gets called when the
/// RECOVER USING block is reached because of an exception.
/// </summary>
/// <param name="e">The exception that triggered the jump into the RECOVER USING block</param>
/// <remarks>
/// The default implementation of this function (in the XSharp.RT assembly) called the installed error handler
/// that is installed with ErrorBlock()
/// The function should then have the following prototype
/// <code language="X#">
/// FUNCTION _SequenceError(e as Exception) AS VOID
/// </code>
/// </remarks>
/// <returns>The result of the call to the error handler installed in the ErrorBlock</returns>
/// <seelso cref='O:XSharp.RT.Functions._Break'>Break Function</seealso>
/// <seelso cref='O:XSharp.RT.Functions.ErrorBlock'>Break Function</seealso>
FUNCTION _SequenceError(e as Exception) AS USUAL
  LOCAL error as XSharp.Error
  IF e IS XSharp.Error VAR err
       error := err
  ELSE
       error := Error{e}
  ENDIF
  RETURN Eval(ErrorBlock(), error)
/// <summary>
/// This function is automatically inserted by the compiler in a compiler generated
/// RECOVER USING block when you have a BEGIN SEQUENCE .. END SEQUENCE in your code
/// without RECOVER USING clause
/// </summary>
/// <param name="u">The parameter that was passed in the BREAK statement or the call to the _Break function</param>
/// <remarks>If a REAL exception occurs then this function is NOT called. The function is only called when
/// the (generated) RECOVER USING block is called with a value from a BREAK statement. <br />
/// The default implementation of this function (in the XSharp.RT assembly) does nothing.
/// You can override this function in your own code if you want.
/// The function should then have the following prototype
/// <code language="X#">
/// FUNCTION _SequenceRecover(u as USUAL) AS VOID
/// </code>
/// </remarks>
/// <seelso cref='O:XSharp.RT.Functions._Break'>Break Function</seealso>
FUNCTION _SequenceRecover(u as USUAL) AS VOID
  RETURN