Table of Contents

Class RuntimeEnvironmentProfile

Namespace
RDCore.SDK.Runtime
Assembly
RDCore.SDK.dll

The default IRuntimeEnvironmentProfile implementation.

public sealed record RuntimeEnvironmentProfile : IRuntimeEnvironmentProfile, IEquatable<RuntimeEnvironmentProfile>
Inheritance
RuntimeEnvironmentProfile
Implements
Inherited Members

Constructors

RuntimeEnvironmentProfile(bool, int, int, bool, OptionCompare, VBErlLineNumbering, bool, SupportedLanguage?, bool, bool, RegionalSettings?)

The default IRuntimeEnvironmentProfile implementation.

public RuntimeEnvironmentProfile(bool Is64Bit, int Lcid, int AnsiCodePage, bool SupportsOptionCompareDatabase, OptionCompare DatabaseCompare = OptionCompare.Text, VBErlLineNumbering ErlLineNumbering = VBErlLineNumbering.DocumentLine, bool AllowDllImports = true, SupportedLanguage? SourceLanguage = null, bool AllowAutomation = true, bool LegacyRegistrySettings = false, RegionalSettings? RegionalSettings = null)

Parameters

Is64Bit bool

Whether the environment is 64-bit.

Lcid int

The environment LCID; 0 for the invariant locale.

AnsiCodePage int

The ANSI code page of the text of a file and of Chr / Asc.

SupportsOptionCompareDatabase bool

Whether Option Compare Database is supported.

DatabaseCompare OptionCompare

The comparison mode Option Compare Database stands for; Text unless said otherwise.

ErlLineNumbering VBErlLineNumbering

What Erl counts as a line; the document line unless said otherwise.

AllowDllImports bool

Whether a Declare'd library import may be called; true unless said otherwise.

SourceLanguage SupportedLanguage

The language the code is written in; RD-VBA unless said otherwise.

AllowAutomation bool

Whether a program may create and call the objects of a referenced library, a host application among them; true unless said otherwise.

LegacyRegistrySettings bool

Whether the legacy settings members use the Windows Registry rather than the workspace application settings; false unless said otherwise.

RegionalSettings RegionalSettings

The regional settings a number or a date is written by as a string, and a string read by as one; en-US (Default) unless said otherwise.

Properties

AllowAutomation

Whether a program may create and call the objects of a referenced library, a host application among them; true unless said otherwise.

public bool AllowAutomation { get; init; }

Property Value

bool

AllowDllImports

Whether a Declare'd library import may be called; true unless said otherwise.

public bool AllowDllImports { get; init; }

Property Value

bool

AnsiCodePage

The ANSI code page of the text of a file and of Chr / Asc.

public int AnsiCodePage { get; init; }

Property Value

int

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.

public Encoding AnsiEncoding { get; }

Property Value

Encoding

Remarks

🚧 The provider supplies only the code pages .NET does not build in, so a code page it does build in (65001, 28591, 20127, 1200) is Latin-1 here, the same as one that does not exist. TODO.

Culture

The CultureInfo for Lcid — drives Option Compare Text, Like, case conversion, and Format$ given a format.

public CultureInfo Culture { get; }

Property Value

CultureInfo

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

The comparison mode Option Compare Database stands for; Text unless said otherwise.

public OptionCompare DatabaseCompare { get; init; }

Property Value

OptionCompare

Default

A 64-bit, invariant-culture, Windows-1252, no-Option Compare Database profile for design-time and tests.

public static IRuntimeEnvironmentProfile Default { get; }

Property Value

IRuntimeEnvironmentProfile

ErlLineNumbering

What Erl counts as a line; the document line unless said otherwise.

public VBErlLineNumbering ErlLineNumbering { get; init; }

Property Value

VBErlLineNumbering

Is64Bit

Whether the environment is 64-bit.

public bool Is64Bit { get; init; }

Property Value

bool

Language

The language the code is written in: what the environment is a dialect of, and so which symbols and statements exist at all.

public SupportedLanguage Language { get; }

Property Value

SupportedLanguage

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 LCID; 0 for the invariant locale.

public int Lcid { get; init; }

Property Value

int

LegacyRegistrySettings

Whether the legacy settings members use the Windows Registry rather than the workspace application settings; false unless said otherwise.

public bool LegacyRegistrySettings { get; init; }

Property Value

bool

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.

public RegionalSettings Regional { get; }

Property Value

RegionalSettings

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.

RegionalSettings

The regional settings a number or a date is written by as a string, and a string read by as one; en-US (Default) unless said otherwise.

public RegionalSettings? RegionalSettings { get; init; }

Property Value

RegionalSettings

SourceLanguage

The language the code is written in; RD-VBA unless said otherwise.

public SupportedLanguage? SourceLanguage { get; init; }

Property Value

SupportedLanguage

SupportsOptionCompareDatabase

Whether Option Compare Database is supported.

public bool SupportsOptionCompareDatabase { get; init; }

Property Value

bool

Methods

From(SdkEnvironmentOptions, SupportedLanguage?)

Builds a profile from bound appsettings.json options, for code written in language.

public static RuntimeEnvironmentProfile From(SdkEnvironmentOptions options, SupportedLanguage? language = null)

Parameters

options SdkEnvironmentOptions
language SupportedLanguage

Returns

RuntimeEnvironmentProfile