Table of Contents

Class VBArrayType

Namespace
RDCore.SDK.Model.Types
Assembly
RDCore.SDK.dll

A VBIntrinsicType<T> representing any type of array data type.

public abstract record VBArrayType : VBIntrinsicType<object[]>, IEquatable<VBType>, IEquatable<VBIntrinsicType>, IEquatable<VBIntrinsicType<object[]>>, IEquatable<VBArrayType>
Inheritance
VBArrayType
Implements
Derived
Inherited Members
Extension Methods

Remarks

The managed type of a value of this data type is object[].

Constructors

VBArrayType(VBType)

A VBIntrinsicType<T> representing any type of array data type.

protected VBArrayType(VBType ItemType)

Parameters

ItemType VBType

The data type of the elements of the array.

Remarks

The managed type of a value of this data type is object[].

Properties

DefaultValue

Gets an empty (uninitialized) VBResizableArrayValue of this type's ItemType.

public override VBTypedValue DefaultValue { get; }

Property Value

VBTypedValue

Remarks

An array that has no dimensions yet is still an array of what it was declared as: TypeName of a Dim a() As Long that nothing has ReDim'd is "Long()". A fresh one each time, an array's cells being mutable storage that no two variables may share.

ItemType

The data type of the elements of the array.

public VBType ItemType { get; init; }

Property Value

VBType

TypeInfo

Gets an instance of the VBResizableArrayType.

public static VBArrayType TypeInfo { get; }

Property Value

VBArrayType

Methods

CreateValue(IBindingHandle)

Recovers the VBArrayValue boxed into handle as a VBRuntimeArrayValue — an array's real storage (its element cells) lives on the array object itself, not in anything a handle could reconstruct piecemeal, so this unboxes the original instance rather than building a new one.

public override VBTypedValue CreateValue(IBindingHandle handle)

Parameters

handle IBindingHandle

Returns

VBTypedValue

Remarks

An array read from a binding that is not known (ForReading(IBindingHandle)) is not known either, and neither is anything read from it: the element cells are the stored array's own, shared, but what an element of it is can no longer be relied on.

SameElementType(VBType, VBType)

Whether an array whose elements are of item is an array of the element type expected, as a call binds an array argument to an array parameter: the static semantics of an argument list check an array argument by it, and a completion list offers an array by it.

public static bool SameElementType(VBType expected, VBType item)

Parameters

expected VBType

The element type of the array the parameter declares.

item VBType

The element type of the array given.

Returns

bool

true when the array given has the same element type, or when either type is not known.

Remarks

Two element types are the same when they are of the same kind and name: an Enum is not taken as a Long, and a fixed-length String * N is a String of another kind. Two Enum types are the same whatever their names, as the call binds them. A type that is not known (VBUnknownType) is not a type that differs.