Table of Contents

Class VBPredeclaredInstanceSymbol

Namespace
RDCore.SDK.Model.Symbols
Assembly
RDCore.SDK.dll

The default instance variable of a class module whose VB_PredeclaredId attribute is True (MS-VBAL §5.2.4.1.2): a variable named after the class, declared as that class, created with module extent as if declared As New — that is, an automatic instantiation variable (AutoInstantiated, §2.5.1) — without any code declaring it, so the class name itself can be used as if it were an automatic instantiation variable, the way UserForm1.Show names a form's default instance.

public sealed record VBPredeclaredInstanceSymbol : BoundTypedSymbol, IEquatable<Symbol>, IEquatable<WorkspaceSymbol>, ITypedSymbol, IEquatable<BoundTypedSymbol>, IEquatable<VBPredeclaredInstanceSymbol>
Inheritance
VBPredeclaredInstanceSymbol
Implements
Inherited Members

Remarks

A class module never binds as a name in the default binding context: its predeclared instance does (ISymbolResolver.ResolveValue). The class itself is still what an As clause or the operand of New names, in the type binding context. The variable is global rather than local to its class module — RD-VBAL §3.1.1.6 calls it a global auto-object.

The variable can be the target of a Set assignment, as it can in MS-VBA, where MS-VBAL §5.2.4.1.2 says it is invalid: Set Widget = Nothing lets go of the object it holds, and the next reference to the variable creates another (RD-VBAL §5.2.4.1.2).

The variable is never Nothing when it is referred to: the reference creates the object, as it does for any automatic instantiation variable.

Constructors

VBPredeclaredInstanceSymbol(VBClassModuleSymbol)

Creates the default instance variable of classModule.

public VBPredeclaredInstanceSymbol(VBClassModuleSymbol classModule)

Parameters

classModule VBClassModuleSymbol

The class module this is the default instance of.

Properties

ClassModule

The class module this is the default instance of.

public VBClassModuleSymbol ClassModule { get; init; }

Property Value

VBClassModuleSymbol