Interface IRuntimeEnvironmentProfile
An immutable description of the host environment an execution session runs in — the facts VBA semantics depend on that are neither in the source nor derivable from it.
public interface IRuntimeEnvironmentProfile
Remarks
Supplied by the environment host (from appsettings.json, overridable by the host). Design-
time and tests use Default.
Properties
AllowAutomation
🎯 Whether a program may create and call the objects of a referenced library - a host application's object model among them (Excel,
Word, Scripting). true unless an administrator said otherwise.
bool AllowAutomation { get; }
Property Value
Remarks
Its own switch, apart from AllowDllImports: automating a spreadsheet and calling an arbitrary export are not the same risk, and one switch for both would be of no use to anyone who needs one and not the other.
AllowDllImports
🎯 Whether a Declare'd library import may actually be called. true unless an
administrator said otherwise.
bool AllowDllImports { get; }
Property Value
AnsiCodePage
The ANSI code page: what a character is as a single byte or two outside a String's own data —
the text of a file, and the non-Unicode behaviour of Chr / Asc.
int AnsiCodePage { get; }
Property Value
Remarks
👉 Not Byte() ↔ String, which reinterprets the string's own UTF-16 data
(MS-VBAL §5.5.1.2.6) and needs no code page at all.
AnsiEncoding
The Encoding of AnsiCodePage: the one encoding the session's files and the standard library's character codes share, so that the two cannot disagree about what a byte is.
Encoding AnsiEncoding { get; }
Property Value
Configuration
🎯 Whether a program is built to be debugged or to be run. Debug unless said otherwise.
VBBuildConfiguration Configuration { get; }
Property Value
Remarks
👉 It is the default of the built-in DEBUG conditional-compilation constant, which a project #Const or a command-line define still overrides;
what a program leaves out follows DEBUG (IsDebugBuild(IRuntimeSession)).
Culture
The CultureInfo for Lcid — drives Option Compare Text,
Like, case conversion, and Format$ given a format.
CultureInfo Culture { get; }
Property Value
Remarks
👉 Not how a value is Let-coerced to or from a String: a number or a date is written and read by Regional, which is the
platform's and not the culture's, so that what CStr writes, CDbl and CDate read back.
DatabaseCompare
OptionCompare DatabaseCompare { get; }
Property Value
Remarks
👉 MS-VBAL leaves Option Compare Database unspecified (§5.2.1.1); a module that declares it compares strings as this says.
ErlAfterErrClear
What Err.Clear does to the line Erl reports: Reset unless a workspace asks for
MS-VBA's behaviour.
VBErlAfterErrClear ErlAfterErrClear { get; }
Property Value
ErlLineNumbering
🎯 What Erl counts as the line a run-time error was raised at. DocumentLine unless a
workspace asks for MS-VBA's own behaviour.
VBErlLineNumbering ErlLineNumbering { get; }
Property Value
ExecutionEngine
🎯 What runs the code of a program: the interpreter, or IL compiled from it where every instruction can be. DefaultExecutionEngine unless said otherwise.
VBExecutionEngine ExecutionEngine { get; }
Property Value
Is64Bit
true for a 64-bit environment. Determines LongPtr width and, on its own operating system (OperatingSystem), the value of
the Win64 and Linux64 conditional-compilation constants.
bool Is64Bit { get; }
Property Value
Language
The language the code is written in: what the environment is a dialect of, and so which symbols and statements exist at all.
SupportedLanguage Language { get; }
Property Value
Remarks
👉 RD-VBA unless the workspace says otherwise. It is not derivable from the source, which is why it is a fact of the environment.
Lcid
The environment locale identifier (LCID). 0 means the invariant locale.
int Lcid { get; }
Property Value
LegacyRegistrySettings
🎯 Whether the legacy settings members (SaveSetting, GetSetting, GetAllSettings, DeleteSetting) use the Windows Registry, as
MS-VBA does. false unless the workspace asks for it: they use the workspace application settings.
bool LegacyRegistrySettings { get; }
Property Value
Remarks
👉 Only Windows has a registry. Elsewhere the workspace application settings are used whatever this says (RD-VBAL §2.1.1).
OperatingSystem
The operating system the environment runs on. With Is64Bit, it decides the built-in Win32, Win64, Mac,
Linux and Linux64 conditional-compilation constants: each is 1 only on its own operating system, and 0 on every other.
VBOperatingSystem OperatingSystem { get; }
Property Value
Remarks
The environment host's is the one it runs on. Windows unless said otherwise.
Regional
🎯 The regional settings of Let-coercion to and from String (MS-VBAL §5.5.1.2.4): a number or a date is written by
them, and a String read by them as a number or a date. The decimal, digit grouping and currency symbols, the Short Date and Long Time
formats, and the window two-digit years are in; en-US unless the platform's configuration says otherwise.
RegionalSettings Regional { get; }
Property Value
Remarks
One source for both directions, as MS-VBA's is the machine's regional settings: a value written as text reads back as the same value.
ReleaseDropsDebugStatements
🎯 Whether a release build leaves out every Debug.Print and Debug.Assert, their arguments unevaluated. false unless said
otherwise: a release build keeps them, and they run as in a debug build.
bool ReleaseDropsDebugStatements { get; }
Property Value
Remarks
A debug build keeps them whatever this says, and a release build's Stop ends the program as End does either way.
SupportsOptionCompareDatabase
true when the host supports the Option Compare Database directive (Microsoft Access).
bool SupportsOptionCompareDatabase { get; }