Table of Contents

Class SdkEnvironmentOptions

Namespace
RDCore.SDK.Server.Configuration
Assembly
RDCore.SDK.dll

Runtime environment settings, bound from appsettings.json. These become the session's IRuntimeEnvironmentProfile.

public record SdkEnvironmentOptions : IEquatable<SdkEnvironmentOptions>
Inheritance
SdkEnvironmentOptions
Implements
Inherited Members

Fields

DefaultExecutionEngine

The engine a program runs with when its configuration names none: the default of ExecutionEngine, and of a RuntimeEnvironmentProfile made without one.

public const VBExecutionEngine DefaultExecutionEngine = Compiled

Field Value

VBExecutionEngine

Remarks

Compiled: a procedure that compiled code cannot run is interpreted, so a program runs in either engine alike. The ExecutionEngine of the platform's RDCore.CLI/appsettings.json holds the same value, and a test holds the two to it: a change of the default changes both.

Properties

AllowAutomation

🎯 Whether a program may create and call the objects of a referenced library, a host application's object model among them. true by default; set it false to refuse every such call.

public bool AllowAutomation { get; set; }

Property Value

bool

Remarks

Its own switch, apart from AllowDllImports: automating a spreadsheet and calling an arbitrary export are not the same risk. Finer-grained answers - per library, per member, per caller - are an IExternalCallInterceptor's job.

AllowDllImports

🎯 Whether a Declare'd library import may actually be called. true by default; set it false to refuse every one of them.

public bool AllowDllImports { get; set; }

Property Value

bool

Remarks

The blunt instrument, and deliberately platform-wide: a VBA environment that can call into native libraries is a way to run arbitrary code, and this is the switch an administrator has that needs no extension installed to work. Finer-grained answers - per library, per entry point, per caller - are an IExternalCallInterceptor's job, and this is the one policy the platform ships with so that the refusal path is exercised whether or not anybody wrote one.

AnsiCodePage

The ANSI code page for Byte() ↔ String and non-Unicode Chr / Asc, and the one a module file without a byte order mark that is not UTF-8 is read and written in (ModuleFileText).

public int AnsiCodePage { get; set; }

Property Value

int

Configuration

🎯 Whether a program is built to be debugged or to be run: Debug (the default) or Release, in which a Stop statement ends the program as End does. It is the default of the built-in DEBUG constant, which a project #Const still overrides.

public VBBuildConfiguration Configuration { get; set; }

Property Value

VBBuildConfiguration

DatabaseCompare

The comparison mode Option Compare Database stands for on this platform: Text or Binary. Microsoft Access compares by the sort order of the database, which is not case-sensitive; that is the default.

public OptionCompare DatabaseCompare { get; set; }

Property Value

OptionCompare

ErlAfterErrClear

What Err.Clear does to the line Erl reports: Reset (the default: 0, as there is no error any more) or Kept (the line of the error it cleared, as MS-VBA does).

public VBErlAfterErrClear ErlAfterErrClear { get; set; }

Property Value

VBErlAfterErrClear

ErlLineNumbering

🎯 What Erl counts as the line a run-time error was raised at: DocumentLine (the default - the line the faulting statement is really on) or LineLabel (the last line-number label before it, bug for bug with MS-VBA).

public VBErlLineNumbering ErlLineNumbering { get; set; }

Property Value

VBErlLineNumbering

ExecutionEngine

🎯 What runs the code of a program: Interpreter or Compiled (IL where every instruction of a procedure can be compiled, the interpreter elsewhere); DefaultExecutionEngine unless said otherwise.

public VBExecutionEngine ExecutionEngine { get; set; }

Property Value

VBExecutionEngine

Is64Bit

true for a 64-bit environment (LongPtr width, and the Win64 or Linux64 conditional-compilation constant of the operating system the environment runs on).

public bool Is64Bit { get; set; }

Property Value

bool

Lcid

The environment locale identifier. 0 (the default) means the invariant locale.

public int Lcid { get; set; }

Property Value

int

LegacyRegistrySettings

🎯 Whether SaveSetting, GetSetting, GetAllSettings and DeleteSetting use the Windows Registry (HKEY_CURRENT_USER\Software\VB and VBA Program Settings), as MS-VBA does. false by default: they use the workspace application settings (the workspace's appsettings.json), like GetJsonSetting.

public bool LegacyRegistrySettings { get; set; }

Property Value

bool

Remarks

Only Windows has a registry: elsewhere this is ignored, and the workspace application settings are used either way.

Regional

🎯 The regional settings a number or a date is written by as a String, and a String read by as one (RegionalSettings): en-US unless said otherwise, whatever the machine's are.

public SdkRegionalOptions Regional { get; set; }

Property Value

SdkRegionalOptions

ReleaseDropsDebugStatements

🎯 Whether a release build leaves out every Debug.Print and Debug.Assert, their arguments unevaluated: false (the default) keeps them, and they run as in a debug build. A debug build keeps them either way.

public bool ReleaseDropsDebugStatements { get; set; }

Property Value

bool

SupportsOptionCompareDatabase

true when the host supports the Option Compare Database directive (Microsoft Access).

public bool SupportsOptionCompareDatabase { get; set; }

Property Value

bool