Table of Contents

Class MidStatementNode

Namespace
RDCore.SDK.Model.AST.Statements
Assembly
RDCore.SDK.dll

MS-VBAL §5.4.3.5 Mid/MidB/Mid$/MidB$ Statement — replaces a span of characters (or bytes, in the MidB/MidB$ forms) within Target, starting at the 1-based position Start, with characters from Value.

public record MidStatementNode : StatementNode, IEquatable<SyntaxNode>, IExecutableNode, IEquatable<StatementNode>, IEquatable<MidStatementNode>
Inheritance
MidStatementNode
Implements
Inherited Members

Remarks

IsByteMode and IsStringInput are independent: all four spellings (Mid, Mid$, MidB, MidB$) are distinct combinations of the two. The runtime replacement mechanics MS-VBAL §5.4.3.5 spells out only ever split on byte vs. character indexing (Mid/Mid$ together vs. MidB/MidB$ together) — but the trailing $ still has to survive into the AST, because it mirrors the same intrinsic-family split as the Mid/Mid$ function overloads (Function Mid(String As Variant, ...) As Variant vs. the String-only $ form): Target/Value coerce against VBVariant without the suffix and against VBString with it. Dropping the suffix here would silently collapse two different static-semantics signatures into one.

Constructors

MidStatementNode(SyntaxNodeId, SourceLocation, bool, bool, ExpressionNode, ExpressionNode, ExpressionNode?, ExpressionNode)

MS-VBAL §5.4.3.5 Mid/MidB/Mid$/MidB$ Statement — replaces a span of characters (or bytes, in the MidB/MidB$ forms) within Target, starting at the 1-based position Start, with characters from Value.

public MidStatementNode(SyntaxNodeId Identity, SourceLocation SourceLocation, bool IsByteMode, bool IsStringInput, ExpressionNode Target, ExpressionNode Start, ExpressionNode? Length, ExpressionNode Value)

Parameters

Identity SyntaxNodeId

A unique identifier for this specific syntax node.

SourceLocation SourceLocation

The document location (Uri+Range) of the bound expression.

IsByteMode bool

true for MidB/MidB$ (byte-indexed); false for Mid/Mid$ (character-indexed).

IsStringInput bool

true when the mode specifier carries the \(</code> suffix (<code>Mid\)/MidB$).

Target ExpressionNode

The bound-variable-expression being modified in place.

Start ExpressionNode

The 1-based position within Target where replacement begins.

Length ExpressionNode

The maximum number of characters/bytes to replace, or null when omitted (replaces through the end of Target or Value, whichever is shorter).

Value ExpressionNode

The expression supplying the replacement characters/bytes.

Remarks

IsByteMode and IsStringInput are independent: all four spellings (Mid, Mid$, MidB, MidB$) are distinct combinations of the two. The runtime replacement mechanics MS-VBAL §5.4.3.5 spells out only ever split on byte vs. character indexing (Mid/Mid$ together vs. MidB/MidB$ together) — but the trailing $ still has to survive into the AST, because it mirrors the same intrinsic-family split as the Mid/Mid$ function overloads (Function Mid(String As Variant, ...) As Variant vs. the String-only $ form): Target/Value coerce against VBVariant without the suffix and against VBString with it. Dropping the suffix here would silently collapse two different static-semantics signatures into one.

Properties

IsByteMode

true for MidB/MidB$ (byte-indexed); false for Mid/Mid$ (character-indexed).

public bool IsByteMode { get; init; }

Property Value

bool

IsStringInput

true when the mode specifier carries the \(</code> suffix (<code>Mid\)/MidB$).

public bool IsStringInput { get; init; }

Property Value

bool

Length

The maximum number of characters/bytes to replace, or null when omitted (replaces through the end of Target or Value, whichever is shorter).

public ExpressionNode? Length { get; init; }

Property Value

ExpressionNode

Start

The 1-based position within Target where replacement begins.

public ExpressionNode Start { get; init; }

Property Value

ExpressionNode

Target

The bound-variable-expression being modified in place.

public ExpressionNode Target { get; init; }

Property Value

ExpressionNode

Value

The expression supplying the replacement characters/bytes.

public ExpressionNode Value { get; init; }

Property Value

ExpressionNode