Table of Contents

4.0 Program Structure and Organization

Note

This section is incomplete at this time.

An RD-VBA Environment is organized into a number of workspace source files and host-defined projects.

The symbol at the top of the abstract syntax tree (AST) of an entire VBA project is of a type inherited from VBProjectType. These types correspond to the project types defined in MS-VBAL §4.1 Projects (see RD-VBAL §2.4.2 Non-intrinsic Types).

Static Execution Context

In design mode (RD-VBAL §2.3.2 Mode / State), the host environment maintains a static execution context. The static execution context is an execution context containing the symbols provided by or defined in the following sources:

Source Symbols
The environment host itself The static symbols it defines.
The workspace source code The symbols defined in it.
All referenced libraries The symbols they provide.
Any extension symbol providers The symbols they provide.
The host Any additional unbound symbols it defines, e.g. via immediate commands.

👉 The static execution context retains the state of immediate commands until an End command (RD-VBAL §5.4.2.22 End Statement) resets the execution context back to its initial state.

Source Projects

A new RD-VBA source project always minimally contains a single standard (procedural) module. That module has a host-defined default name.

The following are host-defined:

  • whether the single module of a new source project contains any directives, annotations, or a templated entry point;
  • whether there are other default/templated modules in a new source project.

For an RD-VBA project without any modules:

A project without any modules Outcome
Validity The project is valid.
Project symbol The project still defines a symbol for the project.
Output The project produces no output.
Running or debugging The host cannot exit design mode to run or debug.

Attaching to a Host Process

RD-VBA is normally hosted in a standalone hosting environment that is self-sufficient.

The environment host must ultimately be able to:

  • attach to an external process that hosts an MS-VBA VBA environment;
  • externally address the host memory space, to enable automation through COM and .NET interoperability.

In principle, external addressing of the host process memory allows a VBVariantValue to wrap an externally-defined object reference (RD-VBAL §2.5.2.1.5 Variant Values).

Note

For Microsoft Office Automation, the attach to host process feature places the RDCore platform in a technical position similar to that of Microsoft VSTO: automating COM from outside the host rather than from within it.

The comparison with Microsoft VSTO extends no further than automating COM from outside the host: a complete RDCore platform could also run RD-VBA CI/CD pipelines and integrate with enterprise software development lifecycles.

The lightweight VBIDE add-in that launches an environment host attached to a host process is specified in RD-VBAL §4.1 VBIDE Synchronization.

4.0.1 Application Composition

Note

Reserved. This section has no content yet.

4.0.2 Execution Pipeline and Interpreter

Note

Reserved. This section has no content yet.

4.0.2.1 Call Stack

Note

Reserved. This section has no content yet.

4.0.2.2 Memory Management

Note

Reserved. This section has no content yet.

4.0.2.3 External Calls

Note

Reserved. This section has no content yet.

4.0.3 Application Teardown

Note

Reserved. This section has no content yet.


⏮️ RD-VBAL §3.5.5 Placement and Licensing | ⏭️ RD-VBAL §4.1 VBIDE Synchronization