Class RuntimeSessionExtensions
What an IRuntimeSession says about the code that is executing in it.
public static class RuntimeSessionExtensions
- Inheritance
-
RuntimeSessionExtensions
- Inherited Members
Fields
DebugConstantName
The name of the conditional compilation constant that says whether this is a debug build.
public const string DebugConstantName = "DEBUG"
Field Value
Remarks
RDCore's own, not MS-VBAL's — VBA has no such constant. It is a conditional compilation
constant rather than a setting of its own so that #If DEBUG Then and "does this
Debug.Print run" cannot disagree, and so that the precedence a project already has over
its constants (a --define beats the .rdproj, which beats the built-in) applies to
it unchanged.
Methods
CurrentCompareMode(IRuntimeSession)
The mode the relational operators compare String values in, at the point of the session's execution
(MS-VBAL §5.2.1.1): the comparison mode of the module declaring the procedure of the current call frame,
Binary if nothing is executing.
public static OptionCompare CurrentCompareMode(this IRuntimeSession session)
Parameters
sessionIRuntimeSessionThe session the code is executing in.
Returns
Remarks
👉 Never Database: a module that declares Option Compare Database compares as the platform
says (DatabaseCompare).
CurrentStringComparison(IRuntimeSession)
How the relational operators compare String values at the point of the session's execution (MS-VBAL §5.6.9.5):
the CurrentCompareMode(IRuntimeSession), collated by the regional settings of the session's environment.
public static StringComparisonRules CurrentStringComparison(this IRuntimeSession session)
Parameters
sessionIRuntimeSessionThe session the code is executing in.
Returns
IsDebugBuild(IRuntimeSession)
Whether this session is running a debug build — whether Debug.Print and
Debug.Assert are lowered and executed at all.
public static bool IsDebugBuild(this IRuntimeSession session)
Parameters
sessionIRuntimeSessionThe session the code is executing in.
Returns
Remarks
False only when DebugConstantName is defined and zero. A session
composed without the constant at all is a debug build: keeping the statements is the
recoverable answer, and silently dropping every Debug.Print because a symbol provider
was missing is not.