CxStatementTry

Description

sealed class Tinman.Core.Cx.Statements.CxStatementTry

A statement that executes a statement block while selectively catching thrown exceptions and optionally executes a second statement as the final step:

try
{
  a = 1;
}
catch(Type a)
{
  a = 2;
}

try
{
  a = 1;
}
finally
{
  a = 3;
}

try
{
  a = 1;
}
catch(Type a)
{
  a = 2;
}
finally
{
  a = 3;
}

ICxVariableContainer.Variable returns the variable declaration of the caught exception, which will be null iff this try statement does not have a catch block. The variable name (see ICxIdContainer.Name) will be NameIgnore iff the catch block does not contain a variable name.

Public / Constants

Name​Ignore


public static readonly attribute NameIgnore → (CxId)

If the catch block does not declare a name for the caught exception, ICxIdContainer.Name will be set to this value: 'ignore'.

Public / Constructors

Cx​Statement​Try


public constructor CxStatementTry → (4)

tryBody in : CxStatementBlock

[not-null]
See TryBody.

catchVariable in : CxVariable

See ICxVariableContainer.Variable.

catchBody in : CxStatementBlock

See catchBody.

finallyBody in : CxStatementBlock

See FinallyBody.

Creates a new instance of CxStatementTry.

Public / Attributes

Catch​Body


[Constant]
public attribute CatchBody → (get)

value : CxStatementBlock

The catch statement block or null iff this try statement does not have a catch block.

Returns the statement block that is executed after catching an exception.

Finally​Body


[Constant]
public attribute FinallyBody → (get)

value : CxStatementBlock

The finally statement block or null iff this try statement does not have a finally block.

Returns the statement block that is executed as the final step.

Try​Body


[Constant]
public attribute TryBody → (get)

value : CxStatementBlock

[not-null]
The body statement block.

Returns the statement block that represents the body of the try statement.