Show / Hide Table of Contents

Struct VmValue

Represents a typed value in the virtual machine.

Inherited Members
ValueType.Equals(object)
ValueType.GetHashCode()
ValueType.ToString()
object.Equals(object, object)
object.GetType()
object.ReferenceEquals(object, object)
Namespace: VM.Core.Instructions
Assembly: VM.dll
Syntax
public struct VmValue

Fields

Type

The type of the value

Declaration
public VmType Type
Field Value
Type Description
VmType

Value

The boxed value

Declaration
public object Value
Field Value
Type Description
object

Methods

AsArray()

Converts to array with type checking

Declaration
public VmArray AsArray()
Returns
Type Description
VmArray
Exceptions
Type Condition
VmTypeException

Thrown when type is not ARRAY

AsBool()

Converts to bool with type checking

Declaration
public bool AsBool()
Returns
Type Description
bool
Exceptions
Type Condition
VmTypeException

Thrown when type is not BOOL

AsFloat()

Converts to float with type checking

Declaration
public float AsFloat()
Returns
Type Description
float
Exceptions
Type Condition
VmTypeException

Thrown when type is not FLOAT

AsInt()

Converts to integer with type checking

Declaration
public int AsInt()
Returns
Type Description
int
Exceptions
Type Condition
VmTypeException

Thrown when type is not INT

AsString()

Converts to string with type checking

Declaration
public string AsString()
Returns
Type Description
string
Exceptions
Type Condition
VmTypeException

Thrown when type is not STRING

FromArray(VmArray)

Creates a new array value

Declaration
public static VmValue FromArray(VmArray value)
Parameters
Type Name Description
VmArray value
Returns
Type Description
VmValue

FromBool(bool)

Creates a new boolean value

Declaration
public static VmValue FromBool(bool value)
Parameters
Type Name Description
bool value
Returns
Type Description
VmValue

FromFloat(float)

Creates a new float value

Declaration
public static VmValue FromFloat(float value)
Parameters
Type Name Description
float value
Returns
Type Description
VmValue

FromInt(int)

Creates a new integer value

Declaration
public static VmValue FromInt(int value)
Parameters
Type Name Description
int value
Returns
Type Description
VmValue

FromString(string)

Creates a new string value

Declaration
public static VmValue FromString(string value)
Parameters
Type Name Description
string value
Returns
Type Description
VmValue
In this article
Back to top Generated by DocFX