Table of Contents

Enum ClassModuleSemanticFlags

Namespace
RDCore.SDK.Semantics.Flags
Assembly
RDCore.SDK.dll

The semantic flags of a class module: facts about the objects of the class (MS-VBAL §5.2.4).

[Flags]
public enum ClassModuleSemanticFlags

Fields

DefaultInstance = 1

The class has a default instance (MS-VBAL §5.2.4.1.2): its VB_PredeclaredId attribute is True, and a global variable named after the class holds an object of it, which is created the first time the name is referred to.

None = 0

No flags set.

Stateful = 2

The class declares variables at module level, which have object extent (MS-VBAL §5.2.3.1), or a member of it declares a Static local: each object of the class - its default instance included - holds a distinct variable of each, and keeps what its members assign to them. MS-VBA gives each object its own of a Static local as well, where MS-VBAL gives a static local module extent (recorded in Excel).

Remarks

A predeclared class whose default instance is DefaultInstance and not Stateful is the usual shape of a factory: its default instance only ever makes objects of the class, and has nothing of its own to remember between two of its calls. One that is Stateful as well keeps what its members assign, in a variable every module can reach by the class's name.