Class VmArray
Represents an array of values in the virtual machine.
Inherited Members
Namespace: VM.Core.Instructions
Assembly: VM.dll
Syntax
public class VmArray
Constructors
VmArray(int, string)
Creates a new array of specified size.
Declaration
public VmArray(int size, string elementType = "any")
Parameters
| Type | Name | Description |
|---|---|---|
| int | size | Number of elements |
| string | elementType | Type description of elements |
Properties
ElementType
Gets the element type of the array
Declaration
public string ElementType { get; }
Property Value
| Type | Description |
|---|---|
| string |
Length
Gets the length of the array
Declaration
public int Length { get; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
Get(int)
Gets an element at the specified index.
Declaration
public VmValue Get(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index |
Returns
| Type | Description |
|---|---|
| VmValue |
Exceptions
| Type | Condition |
|---|---|
| VmException | Thrown when index is out of bounds |
Set(int, VmValue)
Sets an element at the specified index.
Declaration
public void Set(int index, VmValue value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | |
| VmValue | value |
Exceptions
| Type | Condition |
|---|---|
| VmException | Thrown when index is out of bounds |
ToString()
Returns string representation of array contents
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string |