Table of Contents

Class RunValues

Namespace
RDCore.SDK.Model.Values
Assembly
RDCore.SDK.dll

Converts between a value of the language and a RunValue: its type's name (MS-VBAL §2.1), and its value as the invariant text RunValue's remarks give for the type.

public static class RunValues
Inheritance
RunValues
Inherited Members

Remarks

The two conversions are each other's inverse for every type that travels: a value written and read back is the same value, of the same type. A LongPtr is the exception: it is written as the type it is on the platform, and read back as that type.

Methods

ToRunValue(VBTypedValue)

The value as a RunValue.

public static RunValue? ToRunValue(this VBTypedValue value)

Parameters

value VBTypedValue

The value.

Returns

RunValue

The value as a RunValue; null for an indeterminate value, and for a value of no type the remarks of RunValue list, such as Missing.

Remarks

A Variant is written as the value it holds. A LongPtr is written as the type it is on the platform: LongLong on a 64-bit one, Long otherwise. A fixed-length string is a String. A Date is written whole, as yyyy-MM-ddTHH:mm:ss. An Error is its number, as CVErr takes it (MS-VBAL §6.1.2.3.1.14).

An array, a user-defined type and an object are written with their type's name and a null value; Nothing is an Object with a null value.

ToTypedValue(RunValue)

The value a RunValue says.

public static VBTypedValue? ToTypedValue(this RunValue value)

Parameters

value RunValue

The value as it travels.

Returns

VBTypedValue

The value; null for a value that does not travel: an object other than Nothing, an array, a user-defined type, or a type name the remarks of RunValue do not list.

Remarks

A Date is read whole (yyyy-MM-ddTHH:mm:ss), as a date alone (yyyy-MM-dd, at midnight), or as a time alone (HH:mm:ss, on 1899-12-30, day 0 of the Date serial). An Error is the error of that number, as CVErr makes it (MS-VBAL §6.1.2.3.1.14). An Object with a null value is Nothing.

Exceptions

FormatException

The text is not of the form the type's row of the table gives, or is null for a type that has text.

OverflowException

The text is a number out of the type's range.