Table of Contents

Class VBArrayValue.VBArrayDimension

Namespace
RDCore.SDK.Model.Values.Intrinsic
Assembly
RDCore.SDK.dll

Represents an (indexer-enabled) array dimension.

public record VBArrayValue.VBArrayDimension : IEquatable<VBArrayValue.VBArrayDimension>
Inheritance
VBArrayValue.VBArrayDimension
Implements
Inherited Members

Constructors

VBArrayDimension(Symbol, VBType, int, int)

Creates a array dimension of the specified VBType item type and the specified lower and upper bounds.

public VBArrayDimension(Symbol symbol, VBType itemType, int lBound, int uBound)

Parameters

symbol Symbol

The Symbol of the parent VBArrayValue.

itemType VBType
lBound int
uBound int

Properties

IsInitialized

true when the LowerBound is less than or equal to the UpperBound.

public bool IsInitialized { get; }

Property Value

bool

this[int]

Gets the VBTypedValue at the specified subscript if the subscript is within the array bounds.

public VBTypedValue? this[int subscript] { get; }

Parameters

subscript int

Property Value

VBTypedValue

Remarks

💥 Semantics should throw a VBRuntimeErrorException.SubscriptOutOfRange if this indexer returns null.

Length

Returns the length of the array dimension, in terms of number of elements.

public int Length { get; }

Property Value

int

LowerBound

Gets the lower bound of this array dimension. Returns 0 if the array/dimension is not initialized.

public int LowerBound { get; init; }

Property Value

int

Remarks

This value is the underlying value returned by the LBound operator.

UpperBound

Gets the upper bound of this array dimension. Returns -1 if the array/dimension is not initialized.

public int UpperBound { get; init; }

Property Value

int

Remarks

This value is the underlying value returned by the UBound operator.

Methods

Deconstruct(out int, out int)

Allows deconstructing this record into its lower and upper boundaries.

public void Deconstruct(out int lBound, out int uBound)

Parameters

lBound int
uBound int

Remarks

var (lower, upper) = vbArrayValue.Dimensions[0];