Divooka Reference

Array Routines

52 nodes

On this page 52

As Read Only

Function

A read-only view of the array, for handing its contents on without letting the receiver change them.

Signature
AsReadOnly(array: T Array) -> ReadOnlyCollection<T>
ReadOnlyCollection<T> AsReadOnly(T[] array)

Parameters

nametypedefaultdescription
arrayT Array—The array to wrap; null throws System.ArgumentNullException.

Returns

resultReadOnlyCollection<T>

Remarks

The view is not a copy: changes made to the array afterwards show through it.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Clear

Function

Overload 1 of 2

Signature
Clear(array: Array)
void Clear(Array array)

Resets every element of the array, in all dimensions, to its type's default: 0 for numbers, false for booleans, null for text and objects. The array keeps its size.

Parameters

nametypedefaultdescription
arrayArray—The array to clear in place; null throws System.ArgumentNullException.

Overload 2 of 2

Signature
Clear(array: Array, index: Integer, length: Integer)
void Clear(Array array, int index, int length)

Resets a run of elements to their type's default (0, false or null), leaving the rest of the array untouched.

Parameters

nametypedefaultdescription
arrayArray—The array to clear in place; null throws System.ArgumentNullException.
indexInteger—The index of the first element to reset.
lengthInteger—How many elements to reset.

Remarks

An index below the array's lower bound, a negative length, or a run that goes past the end throws System.IndexOutOfRangeException.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Clone

Function

A new array of the same type, shape and contents, so the copy can be changed without affecting the original.

Signature
Clone(array: Array) -> Any
object Clone(Array array)

Parameters

nametypedefaultdescription
arrayArray—The array to copy.

Returns

resultAny

Remarks

The copy is shallow: for elements that are objects, both arrays refer to the same objects.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Constrained Copy

Function

Copies a run of elements from one array into another all-or-nothing: if the copy cannot complete, the destination is left exactly as it was.

Signature
ConstrainedCopy
    sourceArray: Array
    sourceIndex: Integer
    destinationArray: Array
    destinationIndex: Integer
    length: Integer
void ConstrainedCopy(
    Array sourceArray,
    int sourceIndex,
    Array destinationArray,
    int destinationIndex,
    int length)

Parameters

nametypedefaultdescription
sourceArrayArray—The array to copy from.
sourceIndexInteger—The index in the source where copying starts.
destinationArrayArray—The array to copy into; it must have the same number of dimensions as the source.
destinationIndexInteger—The index in the destination where the first copied element lands.
lengthInteger—How many elements to copy; a run past the end of either array throws System.ArgumentException.

Remarks

Unlike Copy, it does not convert between element types: the source element type must be the same as, or derive from, the destination's, otherwise System.ArrayTypeMismatchException is thrown. The two arrays may be the same array with overlapping ranges.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Convert All

Function

A new array made by passing each element through a converter, for turning an array of one type into another, such as numbers into labels.

Signature
ConvertAll -> TOutput Array
    array: TInput Array
    converter: Converter<TInput, TOutput>
TOutput[] ConvertAll(
    TInput[] array,
    Converter<TInput, TOutput> converter)

Parameters

nametypedefaultdescription
arrayTInput Array—The array to convert; it is left unchanged, and null throws System.ArgumentNullException.
converterConverter<TInput, TOutput>—The function applied to each element; null throws System.ArgumentNullException.

Returns

resultTOutput Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Copy

Function

Overload 1 of 4

Signature
Copy
    sourceArray: Array
    sourceIndex: Integer
    destinationArray: Array
    destinationIndex: Integer
    length: Integer
void Copy(
    Array sourceArray,
    int sourceIndex,
    Array destinationArray,
    int destinationIndex,
    int length)

Copies a run of elements from one position in an array to a position in another (or the same) array, converting element types where a widening or boxing conversion allows.

Parameters

nametypedefaultdescription
sourceArrayArray—The array to copy from.
sourceIndexInteger—The index in the source where copying starts.
destinationArrayArray—The array to copy into; it must have the same number of dimensions as the source, otherwise System.RankException is thrown.
destinationIndexInteger—The index in the destination where the first copied element lands.
lengthInteger—How many elements to copy; a run past the end of either array throws System.ArgumentException.

Remarks

Overlapping ranges within the same array are copied correctly. If an element cannot be converted partway through, the destination may be left partly written; use Constrained Copy when that matters.

Overload 2 of 4

Signature
Copy
    sourceArray: Array
    destinationArray: Array
    length: Integer
void Copy(Array sourceArray, Array destinationArray, int length)

Copies the first elements of one array into the start of another, converting element types where a widening or boxing conversion allows.

Parameters

nametypedefaultdescription
sourceArrayArray—The array to copy from.
destinationArrayArray—The array to copy into; it must have the same number of dimensions as the source, otherwise System.RankException is thrown.
lengthInteger—How many elements to copy; more than either array holds throws System.ArgumentException.

Overload 3 of 4

Signature
Copy
    sourceArray: Array
    sourceIndex: Large Integer
    destinationArray: Array
    destinationIndex: Large Integer
    length: Large Integer
void Copy(
    Array sourceArray,
    long sourceIndex,
    Array destinationArray,
    long destinationIndex,
    long length)

Copies a run of elements from one array into another, taking 64-bit positions and count; behaves exactly like the 32-bit Copy.

Parameters

nametypedefaultdescription
sourceArrayArray—The array to copy from.
sourceIndexLarge Integer—The index in the source where copying starts.
destinationArrayArray—The array to copy into; it must have the same number of dimensions as the source.
destinationIndexLarge Integer—The index in the destination where the first copied element lands.
lengthLarge Integer—How many elements to copy; a run past the end of either array throws System.ArgumentException.

Remarks

The values must still fit in the 32-bit range, otherwise System.ArgumentOutOfRangeException is thrown.

Overload 4 of 4

Signature
Copy
    sourceArray: Array
    destinationArray: Array
    length: Large Integer
void Copy(
    Array sourceArray,
    Array destinationArray,
    long length)

Copies the first elements of one array into the start of another, taking a 64-bit count; behaves exactly like the 32-bit Copy.

Parameters

nametypedefaultdescription
sourceArrayArray—The array to copy from.
destinationArrayArray—The array to copy into; it must have the same number of dimensions as the source.
lengthLarge Integer—How many elements to copy; it must fit in the 32-bit range, otherwise System.ArgumentOutOfRangeException is thrown.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Copy To

Function

Overload 1 of 2

Signature
CopyTo(source: Array, destination: Array, index: Large Integer)
void CopyTo(Array source, Array destination, long index)

Copies every element of a one-dimensional array into another array, starting at a 64-bit position in the destination.

Parameters

nametypedefaultdescription
sourceArray—The one-dimensional array to copy from; a multidimensional array throws System.RankException.
destinationArray—The one-dimensional array to copy into; null throws System.ArgumentNullException, and a multidimensional array throws System.ArgumentException.
indexLarge Integer—The position in the destination where the first element lands; it must leave room for every source element, otherwise System.ArgumentException is thrown, and it must fit in the 32-bit range.

Overload 2 of 2

Signature
CopyTo(source: Array, destination: Array, index: Integer)
void CopyTo(Array source, Array destination, int index)

Copies every element of a one-dimensional array into another array, starting at the given position in the destination.

Parameters

nametypedefaultdescription
sourceArray—The one-dimensional array to copy from; a multidimensional array throws System.RankException.
destinationArray—The one-dimensional array to copy into; null throws System.ArgumentNullException, and a multidimensional array throws System.ArgumentException.
indexInteger—The position in the destination where the first element lands; negative throws System.ArgumentOutOfRangeException, and too little room for every source element throws System.ArgumentException.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Create Instance

Function

Overload 1 of 6

Signature
CreateInstance -> Array
    elementType: Type
    lengths: Integer Array
    lowerBounds: Integer Array
Array CreateInstance(
    Type elementType,
    int[] lengths,
    int[] lowerBounds)

A new array of any element type and dimension count, where each dimension can start at an index other than 0 (for example a grid indexed from 1).

Parameters

nametypedefaultdescription
elementTypeType—The type of each element.
lengthsInteger Array—The size of each dimension; its count is the number of dimensions.
lowerBoundsInteger Array—The starting index of each dimension; it must have as many entries as Lengths, otherwise System.ArgumentException is thrown.

Returns

resultArray

Remarks

Every element starts at its type's default value. Element types that cannot form an array, such as void, throw System.NotSupportedException.

Overload 2 of 6

Signature
CreateInstance -> Array
    elementType: Type
    lengths: Large Integer Array
Array CreateInstance(Type elementType, params long[] lengths)

A new zero-based array of any element type, with one dimension per entry in the size list, given as 64-bit sizes.

Parameters

nametypedefaultdescription
elementTypeType—The type of each element.
lengthsLarge Integer Array—The size of each dimension; an empty list throws System.ArgumentException.

Returns

resultArray

Remarks

Every element starts at its type's default value. Each size must fit in the 32-bit range, otherwise System.ArgumentOutOfRangeException is thrown.

Overload 3 of 6

Signature
CreateInstance -> Array
    elementType: Type
    length1: Integer
    length2: Integer
    length3: Integer
Array CreateInstance(
    Type elementType,
    int length1,
    int length2,
    int length3)

A new zero-based three-dimensional array of any element type, for volumes such as voxel grids.

Parameters

nametypedefaultdescription
elementTypeType—The type of each element.
length1Integer—The size of the first dimension; negative throws System.ArgumentOutOfRangeException.
length2Integer—The size of the second dimension; negative throws System.ArgumentOutOfRangeException.
length3Integer—The size of the third dimension; negative throws System.ArgumentOutOfRangeException.

Returns

resultArray

Overload 4 of 6

Signature
CreateInstance -> Array
    elementType: Type
    length1: Integer
    length2: Integer
Array CreateInstance(Type elementType, int length1, int length2)

A new zero-based two-dimensional array of any element type, for grids and tables.

Parameters

nametypedefaultdescription
elementTypeType—The type of each element.
length1Integer—The size of the first dimension (rows); negative throws System.ArgumentOutOfRangeException.
length2Integer—The size of the second dimension (columns); negative throws System.ArgumentOutOfRangeException.

Returns

resultArray

Overload 5 of 6

Signature
CreateInstance(elementType: Type, length: Integer) -> Array
Array CreateInstance(Type elementType, int length)

A new zero-based one-dimensional array of an element type chosen at run time.

Parameters

nametypedefaultdescription
elementTypeType—The type of each element.
lengthInteger—How many elements the array has; negative throws System.ArgumentOutOfRangeException.

Returns

resultArray

Overload 6 of 6

Signature
CreateInstance -> Array
    elementType: Type
    lengths: Integer Array
Array CreateInstance(Type elementType, params int[] lengths)

A new zero-based array of any element type, with one dimension per entry in the size list.

Parameters

nametypedefaultdescription
elementTypeType—The type of each element.
lengthsInteger Array—The size of each dimension; an empty list throws System.ArgumentException, and a negative size throws System.ArgumentOutOfRangeException.

Returns

resultArray
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Create Instance From Array Type

Function

Overload 1 of 3

Signature
CreateInstanceFromArrayType -> Array
    arrayType: Type
    lengths: Integer Array
Array CreateInstanceFromArrayType(
    Type arrayType,
    params int[] lengths)

A new array of the given array type (for example a number grid type), with the given size for each of its dimensions.

Parameters

nametypedefaultdescription
arrayTypeType—The array type to create, not its element type; a type that is not an array throws System.ArgumentException.
lengthsInteger Array—The size of each dimension; the count must match the array type's dimension count, otherwise System.ArgumentException is thrown.

Returns

resultArray

Overload 2 of 3

Signature
CreateInstanceFromArrayType -> Array
    arrayType: Type
    lengths: Integer Array
    lowerBounds: Integer Array
Array CreateInstanceFromArrayType(
    Type arrayType,
    int[] lengths,
    int[] lowerBounds)

A new array of the given array type, with a size and a starting index for each dimension.

Parameters

nametypedefaultdescription
arrayTypeType—The array type to create, not its element type; a type that is not an array throws System.ArgumentException.
lengthsInteger Array—The size of each dimension; the count must match the array type's dimension count.
lowerBoundsInteger Array—The starting index of each dimension; it must have as many entries as Lengths.

Returns

resultArray

Overload 3 of 3

Signature
CreateInstanceFromArrayType -> Array
    arrayType: Type
    length: Integer
Array CreateInstanceFromArrayType(Type arrayType, int length)

A new one-dimensional array of the given array type and length.

Parameters

nametypedefaultdescription
arrayTypeType—The one-dimensional array type to create, not its element type; a type that is not an array throws System.ArgumentException.
lengthInteger—How many elements the array has; negative throws System.ArgumentOutOfRangeException.

Returns

resultArray
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Parse Comma Separated Boolean Array

Function

This node carries no documentation.

Signature
CSVBoolArray(value: Text) -> Truth Array
bool[] CSVBoolArray(string value)

Parameters

nametypedefaultdescription
valueText—

Returns

resultTruth Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Parse Comma Separated Number Array

Function

This node carries no documentation.

Signature
CSVNumberArray(value: Text) -> Number Array
double[] CSVNumberArray(string value)

Parameters

nametypedefaultdescription
valueText—

Returns

resultNumber Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Parse Comma Separated Text Names

Function

This node carries no documentation.

Signature
CSVStringArray(value: Text) -> Text Array
string[] CSVStringArray(string value)

Parameters

nametypedefaultdescription
valueText—

Returns

resultText Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Duplicate As Array

Function

This node carries no documentation.

Signature
DuplicateAsArray(source: TType, count: Integer) -> TType Array
TType[] DuplicateAsArray(TType source, int count = 3)

Parameters

nametypedefaultdescription
sourceTType—
countInteger3

Returns

resultTType Array

Remarks

Prefer strongly typed over object-boxed version of ArrayRoutines.DuplicateAsArray.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Empty

Function

An array with no elements, for when a result has nothing in it; the same shared instance is returned every time, so it costs no allocation.

Signature
Empty() -> T Array
T[] Empty()

Returns

resultT Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Exists

Function

Whether at least one element passes a test, for questions such as "is any value negative?".

Signature
Exists(array: T Array, match: Predicate<T>) -> Truth
bool Exists(T[] array, Predicate<T> match)

Parameters

nametypedefaultdescription
arrayT Array—The array to check; null throws System.ArgumentNullException.
matchPredicate<T>—The test applied to each element; null throws System.ArgumentNullException.

Returns

resultTruth
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Fill

Function

Overload 1 of 2

Signature
Fill
    array: T Array
    value: T
    startIndex: Integer
    count: Integer
void Fill(T[] array, T value, int startIndex, int count)

Overwrites a run of elements with one value, leaving the rest of the array as it was.

Parameters

nametypedefaultdescription
arrayT Array—The array to fill in place; null throws System.ArgumentNullException.
valueT—The value written into each element of the run.
startIndexInteger—The index of the first element to overwrite.
countInteger—How many elements to overwrite; a run outside the array throws System.ArgumentOutOfRangeException.

Overload 2 of 2

Signature
Fill(array: T Array, value: T)
void Fill(T[] array, T value)

Overwrites every element of the array with one value, for resetting it to a known state.

Parameters

nametypedefaultdescription
arrayT Array—The array to fill in place; null throws System.ArgumentNullException.
valueT—The value written into every element.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Find

Function

The first element, from the front, that passes a test.

Signature
Find(array: T Array, match: Predicate<T>) -> T
T Find(T[] array, Predicate<T> match)

Parameters

nametypedefaultdescription
arrayT Array—The array to search; null throws System.ArgumentNullException.
matchPredicate<T>—The test applied to each element; null throws System.ArgumentNullException.

Returns

ResultT
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Find All

Function

Every element that passes a test, as a new array, for filtering an array down to the entries you want.

Signature
FindAll(array: T Array, match: Predicate<T>) -> T Array
T[] FindAll(T[] array, Predicate<T> match)

Parameters

nametypedefaultdescription
arrayT Array—The array to filter; it is left unchanged, and null throws System.ArgumentNullException.
matchPredicate<T>—The test applied to each element; null throws System.ArgumentNullException.

Returns

resultT Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Find Index

Function

Overload 1 of 3

Signature
FindIndex -> Integer
    array: T Array
    startIndex: Integer
    count: Integer
    match: Predicate<T>
int FindIndex(
    T[] array,
    int startIndex,
    int count,
    Predicate<T> match)

The position of the first element passing a test within a section of the array, searching forwards.

Parameters

nametypedefaultdescription
arrayT Array—The array to search; null throws System.ArgumentNullException.
startIndexInteger—The index where the search starts.
countInteger—How many elements to examine; a section outside the array throws System.ArgumentOutOfRangeException.
matchPredicate<T>—The test applied to each element; null throws System.ArgumentNullException.

Returns

resultInteger

Overload 2 of 3

Signature
FindIndex(array: T Array, match: Predicate<T>) -> Integer
int FindIndex(T[] array, Predicate<T> match)

The position of the first element that passes a test, searching from the front.

Parameters

nametypedefaultdescription
arrayT Array—The array to search; null throws System.ArgumentNullException.
matchPredicate<T>—The test applied to each element; null throws System.ArgumentNullException.

Returns

resultInteger

Overload 3 of 3

Signature
FindIndex -> Integer
    array: T Array
    startIndex: Integer
    match: Predicate<T>
int FindIndex(T[] array, int startIndex, Predicate<T> match)

The position of the first element passing a test, searching forwards from a given index to the end.

Parameters

nametypedefaultdescription
arrayT Array—The array to search; null throws System.ArgumentNullException.
startIndexInteger—The index where the search starts; outside 0 to the array's length throws System.ArgumentOutOfRangeException.
matchPredicate<T>—The test applied to each element; null throws System.ArgumentNullException.

Returns

resultInteger
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Find Last

Function

The last element, searching from the back, that passes a test.

Signature
FindLast(array: T Array, match: Predicate<T>) -> T
T FindLast(T[] array, Predicate<T> match)

Parameters

nametypedefaultdescription
arrayT Array—The array to search; null throws System.ArgumentNullException.
matchPredicate<T>—The test applied to each element; null throws System.ArgumentNullException.

Returns

ResultT
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Find Last Index

Function

Overload 1 of 3

Signature
FindLastIndex(array: T Array, match: Predicate<T>) -> Integer
int FindLastIndex(T[] array, Predicate<T> match)

The position of the last element that passes a test, searching from the back.

Parameters

nametypedefaultdescription
arrayT Array—The array to search; null throws System.ArgumentNullException.
matchPredicate<T>—The test applied to each element; null throws System.ArgumentNullException.

Returns

resultInteger

Overload 2 of 3

Signature
FindLastIndex -> Integer
    array: T Array
    startIndex: Integer
    match: Predicate<T>
int FindLastIndex(T[] array, int startIndex, Predicate<T> match)

The position of the last element passing a test, searching backwards from a given index to the start.

Parameters

nametypedefaultdescription
arrayT Array—The array to search; null throws System.ArgumentNullException.
startIndexInteger—The index where the backward search starts; outside the array throws System.ArgumentOutOfRangeException.
matchPredicate<T>—The test applied to each element; null throws System.ArgumentNullException.

Returns

resultInteger

Overload 3 of 3

Signature
FindLastIndex -> Integer
    array: T Array
    startIndex: Integer
    count: Integer
    match: Predicate<T>
int FindLastIndex(
    T[] array,
    int startIndex,
    int count,
    Predicate<T> match)

The position of the last element passing a test within a section that ends at a given index, searching backwards.

Parameters

nametypedefaultdescription
arrayT Array—The array to search; null throws System.ArgumentNullException.
startIndexInteger—The index where the backward search starts, which is the last element of the section.
countInteger—How many elements to examine, going backwards; a section outside the array throws System.ArgumentOutOfRangeException.
matchPredicate<T>—The test applied to each element; null throws System.ArgumentNullException.

Returns

resultInteger
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Fold

Function

The whole array folded into one value: starting from the seed, function(accumulated, element), left to right.

Signature
Fold -> Number
    values: Number Array
    seed: Number
    function: Func<Number, Number, Number>
double Fold(
    double[] values,
    double seed,
    Func<double, double, double> function)

Parameters

nametypedefaultdescription
valuesNumber Array—
seedNumber—
functionFunc<Number, Number, Number>—

Returns

resultNumber
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

For Each

Function

Runs an action once for each element, front to back, for side effects such as printing or accumulating.

Signature
ForEach(array: T Array, action: Action<T>)
void ForEach(T[] array, Action<T> action)

Parameters

nametypedefaultdescription
arrayT Array—The array to walk; null throws System.ArgumentNullException.
actionAction<T>—The action run on each element; null throws System.ArgumentNullException.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Get Enumerator

Function

An enumerator that walks every element of the array in order; a multidimensional array is walked with the last dimension changing fastest.

Signature
GetEnumerator(array: Array) -> IEnumerator
IEnumerator GetEnumerator(Array array)

Parameters

nametypedefaultdescription
arrayArray—The array to walk.

Returns

resultIEnumerator
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Get Length

Function

The number of elements along one dimension, for example the number of rows (dimension 0) or columns (dimension 1) of a grid.

Signature
GetLength(array: Array, dimension: Integer) -> Integer
int GetLength(Array array, int dimension)

Parameters

nametypedefaultdescription
arrayArray—The array to inspect.
dimensionInteger—The zero-based dimension to measure; below 0 or not less than the array's dimension count throws System.IndexOutOfRangeException.

Returns

resultInteger
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Get Long Length

Function

The number of elements along one dimension, as a 64-bit number.

Signature
GetLongLength(array: Array, dimension: Integer) -> Large Integer
long GetLongLength(Array array, int dimension)

Parameters

nametypedefaultdescription
arrayArray—The array to inspect.
dimensionInteger—The zero-based dimension to measure; below 0 or not less than the array's dimension count throws System.IndexOutOfRangeException.

Returns

resultLarge Integer
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Get Lower Bound

Function

The first valid index along one dimension; 0 for ordinary arrays, other values only for arrays created with explicit lower bounds.

Signature
GetLowerBound(array: Array, dimension: Integer) -> Integer
int GetLowerBound(Array array, int dimension)

Parameters

nametypedefaultdescription
arrayArray—The array to inspect.
dimensionInteger—The zero-based dimension to inspect; below 0 or not less than the array's dimension count throws System.IndexOutOfRangeException.

Returns

resultInteger
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Get Upper Bound

Function

The last valid index along one dimension, inclusive; for an ordinary array this is that dimension's length minus 1, and -1 for an empty dimension.

Signature
GetUpperBound(array: Array, dimension: Integer) -> Integer
int GetUpperBound(Array array, int dimension)

Parameters

nametypedefaultdescription
arrayArray—The array to inspect.
dimensionInteger—The zero-based dimension to inspect; below 0 or not less than the array's dimension count throws System.IndexOutOfRangeException.

Returns

resultInteger
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Get Value

Function

Overload 1 of 8

Signature
GetValue -> Any
    array: Array
    index1: Large Integer
    index2: Large Integer
    index3: Large Integer
object GetValue(
    Array array,
    long index1,
    long index2,
    long index3)

Reads the element at a position in a three-dimensional array, given as 64-bit indices.

Parameters

nametypedefaultdescription
arrayArray—The three-dimensional array to read; any other dimension count throws System.ArgumentException.
index1Large Integer—The index along the first dimension.
index2Large Integer—The index along the second dimension.
index3Large Integer—The index along the third dimension.

Returns

resultAny

Overload 2 of 8

Signature
GetValue -> Any
    array: Array
    index1: Large Integer
    index2: Large Integer
object GetValue(Array array, long index1, long index2)

Reads the element at a position in a two-dimensional array, given as 64-bit indices.

Parameters

nametypedefaultdescription
arrayArray—The two-dimensional array to read; any other dimension count throws System.ArgumentException.
index1Large Integer—The index along the first dimension (row).
index2Large Integer—The index along the second dimension (column).

Returns

resultAny

Overload 3 of 8

Signature
GetValue(array: Array, index: Large Integer) -> Any
object GetValue(Array array, long index)

Reads the element at a position in a one-dimensional array, given as a 64-bit index.

Parameters

nametypedefaultdescription
arrayArray—The one-dimensional array to read; any other dimension count throws System.ArgumentException.
indexLarge Integer—The position of the element.

Returns

resultAny

Overload 4 of 8

Signature
GetValue(array: Array, index: Integer) -> Any
object GetValue(Array array, int index)

Reads the element at a position in a one-dimensional array of any element type.

Parameters

nametypedefaultdescription
arrayArray—The one-dimensional array to read; any other dimension count throws System.ArgumentException.
indexInteger—The position of the element.

Returns

resultAny

Overload 5 of 8

Signature
GetValue(array: Array, index1: Integer, index2: Integer) -> Any
object GetValue(Array array, int index1, int index2)

Reads the element at a row and column of a two-dimensional array.

Parameters

nametypedefaultdescription
arrayArray—The two-dimensional array to read; any other dimension count throws System.ArgumentException.
index1Integer—The index along the first dimension (row).
index2Integer—The index along the second dimension (column).

Returns

resultAny

Overload 6 of 8

Signature
GetValue -> Any
    array: Array
    index1: Integer
    index2: Integer
    index3: Integer
object GetValue(Array array, int index1, int index2, int index3)

Reads the element at a position in a three-dimensional array.

Parameters

nametypedefaultdescription
arrayArray—The three-dimensional array to read; any other dimension count throws System.ArgumentException.
index1Integer—The index along the first dimension.
index2Integer—The index along the second dimension.
index3Integer—The index along the third dimension.

Returns

resultAny

Overload 7 of 8

Signature
GetValue(array: Array, indices: Integer Array) -> Any
object GetValue(Array array, params int[] indices)

Reads the element at a position given as one index per dimension, for arrays of any dimension count.

Parameters

nametypedefaultdescription
arrayArray—The array to read.
indicesInteger Array—One index per dimension; a count different from the array's dimension count throws System.ArgumentException, and null throws System.ArgumentNullException.

Returns

resultAny

Overload 8 of 8

Signature
GetValue(array: Array, indices: Large Integer Array) -> Any
object GetValue(Array array, params long[] indices)

Reads the element at a position given as one 64-bit index per dimension, for arrays of any dimension count.

Parameters

nametypedefaultdescription
arrayArray—The array to read.
indicesLarge Integer Array—One index per dimension; a count different from the array's dimension count throws System.ArgumentException, and null throws System.ArgumentNullException.

Returns

resultAny
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Index Of

Function

Overload 1 of 6

Signature
IndexOf -> Integer
    array: T Array
    value: T
    startIndex: Integer
    count: Integer
int IndexOf(T[] array, T value, int startIndex, int count)

The position of the first element equal to a value within a section of the array, searching forwards.

Parameters

nametypedefaultdescription
arrayT Array—The array to search; null throws System.ArgumentNullException.
valueT—The value to look for, compared by equality.
startIndexInteger—The index where the search starts.
countInteger—How many elements to examine; a section outside the array throws System.ArgumentOutOfRangeException.

Returns

resultInteger

Overload 2 of 6

Signature
IndexOf -> Integer
    array: T Array
    value: T
    startIndex: Integer
int IndexOf(T[] array, T value, int startIndex)

The position of the first element equal to a value, searching forwards from a given index to the end.

Parameters

nametypedefaultdescription
arrayT Array—The array to search; null throws System.ArgumentNullException.
valueT—The value to look for, compared by equality.
startIndexInteger—The index where the search starts; outside 0 to the array's length throws System.ArgumentOutOfRangeException.

Returns

resultInteger

Overload 3 of 6

Signature
IndexOf(array: T Array, value: T) -> Integer
int IndexOf(T[] array, T value)

The position of the first element equal to a value, searching from the front.

Parameters

nametypedefaultdescription
arrayT Array—The array to search; null throws System.ArgumentNullException.
valueT—The value to look for, compared by equality.

Returns

resultInteger

Overload 4 of 6

Signature
IndexOf(array: Array, value: Any) -> Integer
int IndexOf(Array array, object value)

The position of the first element equal to a value in a one-dimensional array of any element type, searching from the front.

Parameters

nametypedefaultdescription
arrayArray—The one-dimensional array to search; null throws System.ArgumentNullException, and a multidimensional array throws System.RankException.
valueAny—The value to look for, compared by equality.

Returns

resultInteger

Overload 5 of 6

Signature
IndexOf -> Integer
    array: Array
    value: Any
    startIndex: Integer
int IndexOf(Array array, object value, int startIndex)

The position of the first element equal to a value in a one-dimensional array of any element type, searching forwards from a given index to the end.

Parameters

nametypedefaultdescription
arrayArray—The one-dimensional array to search; null throws System.ArgumentNullException, and a multidimensional array throws System.RankException.
valueAny—The value to look for, compared by equality.
startIndexInteger—The index where the search starts; outside the array throws System.ArgumentOutOfRangeException.

Returns

resultInteger

Overload 6 of 6

Signature
IndexOf -> Integer
    array: Array
    value: Any
    startIndex: Integer
    count: Integer
int IndexOf(
    Array array,
    object value,
    int startIndex,
    int count)

The position of the first element equal to a value within a section of a one-dimensional array of any element type, searching forwards.

Parameters

nametypedefaultdescription
arrayArray—The one-dimensional array to search; null throws System.ArgumentNullException, and a multidimensional array throws System.RankException.
valueAny—The value to look for, compared by equality.
startIndexInteger—The index where the search starts.
countInteger—How many elements to examine; a section outside the array throws System.ArgumentOutOfRangeException.

Returns

resultInteger
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Initialize

Function

Runs the element type's parameterless constructor on every element of an array of value types; for arrays of objects, numbers or other types without such a constructor it does nothing.

Signature
Initialize(array: Array)
void Initialize(Array array)

Parameters

nametypedefaultdescription
arrayArray—The array to initialise in place.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Is Fixed Size

Function

Whether the array's size is fixed; always true, since an array cannot grow or shrink in place (Resize makes a new array instead).

Signature
IsFixedSize(array: Array) -> Truth
bool IsFixedSize(Array array)

Parameters

nametypedefaultdescription
arrayArray—The array to inspect.

Returns

resultTruth
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Is Read Only

Function

Whether the array's elements can be changed; always false for an array, because every array's elements are writable (wrap it with As Read Only for a view that cannot be written through).

Signature
IsReadOnly(array: Array) -> Truth
bool IsReadOnly(Array array)

Parameters

nametypedefaultdescription
arrayArray—The array to inspect.

Returns

resultTruth
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Is Synchronized

Function

Whether access to the array is thread-safe on its own; always false for an array, so lock on SyncRoot when several threads share one.

Signature
IsSynchronized(array: Array) -> Truth
bool IsSynchronized(Array array)

Parameters

nametypedefaultdescription
arrayArray—The array to inspect.

Returns

resultTruth
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Last Index Of

Function

Overload 1 of 6

Signature
LastIndexOf -> Integer
    array: Array
    value: Any
    startIndex: Integer
    count: Integer
int LastIndexOf(
    Array array,
    object value,
    int startIndex,
    int count)

The position of the last element equal to a value within a section of a one-dimensional array of any element type that ends at a given index, searching backwards.

Parameters

nametypedefaultdescription
arrayArray—The one-dimensional array to search; null throws System.ArgumentNullException, and a multidimensional array throws System.RankException.
valueAny—The value to look for, compared by equality.
startIndexInteger—The index where the backward search starts, which is the last element of the section.
countInteger—How many elements to examine, going backwards; a section outside the array throws System.ArgumentOutOfRangeException.

Returns

resultInteger

Overload 2 of 6

Signature
LastIndexOf -> Integer
    array: T Array
    value: T
    startIndex: Integer
    count: Integer
int LastIndexOf(T[] array, T value, int startIndex, int count)

The position of the last element equal to a value within a section that ends at a given index, searching backwards.

Parameters

nametypedefaultdescription
arrayT Array—The array to search; null throws System.ArgumentNullException.
valueT—The value to look for, compared by equality.
startIndexInteger—The index where the backward search starts, which is the last element of the section.
countInteger—How many elements to examine, going backwards; a section outside the array throws System.ArgumentOutOfRangeException.

Returns

resultInteger

Overload 3 of 6

Signature
LastIndexOf -> Integer
    array: T Array
    value: T
    startIndex: Integer
int LastIndexOf(T[] array, T value, int startIndex)

The position of the last element equal to a value, searching backwards from a given index to the start.

Parameters

nametypedefaultdescription
arrayT Array—The array to search; null throws System.ArgumentNullException.
valueT—The value to look for, compared by equality.
startIndexInteger—The index where the backward search starts; outside the array throws System.ArgumentOutOfRangeException.

Returns

resultInteger

Overload 4 of 6

Signature
LastIndexOf(array: T Array, value: T) -> Integer
int LastIndexOf(T[] array, T value)

The position of the last element equal to a value, searching from the back.

Parameters

nametypedefaultdescription
arrayT Array—The array to search; null throws System.ArgumentNullException.
valueT—The value to look for, compared by equality.

Returns

resultInteger

Overload 5 of 6

Signature
LastIndexOf -> Integer
    array: Array
    value: Any
    startIndex: Integer
int LastIndexOf(Array array, object value, int startIndex)

The position of the last element equal to a value in a one-dimensional array of any element type, searching backwards from a given index to the start.

Parameters

nametypedefaultdescription
arrayArray—The one-dimensional array to search; null throws System.ArgumentNullException, and a multidimensional array throws System.RankException.
valueAny—The value to look for, compared by equality.
startIndexInteger—The index where the backward search starts; outside the array throws System.ArgumentOutOfRangeException.

Returns

resultInteger

Overload 6 of 6

Signature
LastIndexOf(array: Array, value: Any) -> Integer
int LastIndexOf(Array array, object value)

The position of the last element equal to a value in a one-dimensional array of any element type, searching from the back.

Parameters

nametypedefaultdescription
arrayArray—The one-dimensional array to search; null throws System.ArgumentNullException, and a multidimensional array throws System.RankException.
valueAny—The value to look for, compared by equality.

Returns

resultInteger
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Length

Function

The total number of elements across all dimensions of the array, so a 3 by 4 grid gives 12.

Signature
Length(array: Array) -> Integer
int Length(Array array)

Parameters

nametypedefaultdescription
arrayArray—The array to count.

Returns

resultInteger
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Long Length

Function

The total number of elements across all dimensions of the array, as a 64-bit number; use it instead of Length when a count could exceed the 32-bit range.

Signature
LongLength(array: Array) -> Large Integer
long LongLength(Array array)

Parameters

nametypedefaultdescription
arrayArray—The array to count.

Returns

resultLarge Integer
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Make Array

Function

This node carries no documentation.

Signature
MakeArray(count: Integer) -> TType Array
TType[] MakeArray(int count)

Parameters

nametypedefaultdescription
countInteger—

Returns

resultTType Array

Remarks

The element type is the node's TType generic argument (a node property since format v1.2).

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Make Boolean Array

Function

This node carries no documentation.

Signature
MakeBoolArray(values: Truth Array) -> Truth Array
bool[] MakeBoolArray(params bool[] values)

Parameters

nametypedefaultdescription
valuesTruth Array—

Returns

resultTruth Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Make Number Array

Function

This node carries no documentation.

Signature
MakeNumberArray(values: Number Array) -> Number Array
double[] MakeNumberArray(params double[] values)

Parameters

nametypedefaultdescription
valuesNumber Array—

Returns

resultNumber Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Make Text Array

Function

This node carries no documentation.

Signature
MakeStringArray(values: Text Array) -> Text Array
string[] MakeStringArray(params string[] values)

Parameters

nametypedefaultdescription
valuesText Array—

Returns

resultText Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Map

Function

Each element through a function: the array that comes back is the results, in order.

Signature
Map -> Number Array
    values: Number Array
    function: Func<Number, Number>
double[] Map(double[] values, Func<double, double> function)

Parameters

nametypedefaultdescription
valuesNumber Array—
functionFunc<Number, Number>—

Returns

resultNumber Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Max Length

Function

The largest number of elements any single array can hold on this runtime (2,147,483,591), useful as an upper limit when checking a requested size before allocating.

Signature
MaxLength() -> Integer
int MaxLength()

Returns

resultInteger
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Rank

Function

The number of dimensions of the array: 1 for a plain list of values, 2 for a grid, 3 for a volume.

Signature
Rank(array: Array) -> Integer
int Rank(Array array)

Parameters

nametypedefaultdescription
arrayArray—The array to inspect.

Returns

resultInteger
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Replicate

Function

A new array holding the same value in every slot, for when you need a run of identical entries such as a row of zeros or a default label repeated.

Signature
Replicate(value: TType, count: Integer) -> TType Array
TType[] Replicate(TType value, int count)

Parameters

nametypedefaultdescription
valueTType—The value placed in every slot.
countInteger—How many slots the array has; 0 gives an empty array, and a negative count throws System.OverflowException.

Returns

resultTType Array

Remarks

For a reference type every slot holds the same object, not a copy of it, so changing that object through one slot shows through all of them.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Resize

Function

Changes an array's length by replacing it with a new array of the new size that keeps the existing elements from the front.

Signature
Resize(array: T Array, newSize: Integer)
void Resize(ref T[] array, int newSize)

Parameters

nametypedefaultdescription
arrayT Array—The array to resize; on return it refers to the resized array.
newSizeInteger—The new number of elements; negative throws System.ArgumentOutOfRangeException.

Remarks

Growing adds default-valued (0, false or null) elements at the end; shrinking drops the elements past the new length; the same size leaves the array alone. A null array is replaced by a new array of the requested size.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Reverse

Function

Overload 1 of 4

Signature
Reverse(array: T Array, index: Integer, length: Integer)
void Reverse(T[] array, int index, int length)

Reverses the order of a run of elements in place, leaving the rest of the array as it was.

Parameters

nametypedefaultdescription
arrayT Array—The array to modify; null throws System.ArgumentNullException.
indexInteger—The index of the first element of the run.
lengthInteger—How many elements the run covers; a negative index or length throws System.ArgumentOutOfRangeException, and a run past the end throws System.ArgumentException.

Overload 2 of 4

Signature
Reverse(array: Array, index: Integer, length: Integer)
void Reverse(Array array, int index, int length)

Reverses the order of a run of elements in place in a one-dimensional array of any element type.

Parameters

nametypedefaultdescription
arrayArray—The one-dimensional array to modify; null throws System.ArgumentNullException, and a multidimensional array throws System.RankException.
indexInteger—The index of the first element of the run.
lengthInteger—How many elements the run covers; a negative index or length throws System.ArgumentOutOfRangeException, and a run past the end throws System.ArgumentException.

Overload 3 of 4

Signature
Reverse(array: Array)
void Reverse(Array array)

Reverses the order of all elements in place in a one-dimensional array of any element type, so the last becomes first.

Parameters

nametypedefaultdescription
arrayArray—The one-dimensional array to modify; null throws System.ArgumentNullException, and a multidimensional array throws System.RankException.

Overload 4 of 4

Signature
Reverse(array: T Array)
void Reverse(T[] array)

Reverses the order of all elements in place, so the last becomes first.

Parameters

nametypedefaultdescription
arrayT Array—The array to modify; null throws System.ArgumentNullException.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Set Value

Function

Overload 1 of 8

Signature
SetValue
    array: Array
    value: Any
    index1: Large Integer
    index2: Large Integer
void SetValue(
    Array array,
    object value,
    long index1,
    long index2)

Writes a value into a two-dimensional array at a row and column given as 64-bit indices.

Parameters

nametypedefaultdescription
arrayArray—The two-dimensional array to write; any other dimension count throws System.ArgumentException.
valueAny—The value to store; one that cannot be converted to the element type throws System.InvalidCastException.
index1Large Integer—The index along the first dimension (row).
index2Large Integer—The index along the second dimension (column); an index beyond the 32-bit range throws System.ArgumentOutOfRangeException, and one outside its dimension throws System.IndexOutOfRangeException.

Overload 2 of 8

Signature
SetValue(array: Array, value: Any, index: Large Integer)
void SetValue(Array array, object value, long index)

Writes a value into a one-dimensional array at a position given as a 64-bit index.

Parameters

nametypedefaultdescription
arrayArray—The one-dimensional array to write; any other dimension count throws System.ArgumentException.
valueAny—The value to store; one that cannot be converted to the element type throws System.InvalidCastException.
indexLarge Integer—The position to write; beyond the 32-bit range throws System.ArgumentOutOfRangeException, and outside the array throws System.IndexOutOfRangeException.

Overload 3 of 8

Signature
SetValue(array: Array, value: Any, indices: Integer Array)
void SetValue(Array array, object value, params int[] indices)

Writes a value at a position given as one index per dimension, for arrays of any dimension count.

Parameters

nametypedefaultdescription
arrayArray—The array to write.
valueAny—The value to store; one that cannot be converted to the element type throws System.InvalidCastException.
indicesInteger Array—One index per dimension; a count different from the array's dimension count throws System.ArgumentException, and an index outside its dimension throws System.IndexOutOfRangeException.

Overload 4 of 8

Signature
SetValue
    array: Array
    value: Any
    index1: Integer
    index2: Integer
    index3: Integer
void SetValue(
    Array array,
    object value,
    int index1,
    int index2,
    int index3)

Writes a value into a three-dimensional array at the given position.

Parameters

nametypedefaultdescription
arrayArray—The three-dimensional array to write; any other dimension count throws System.ArgumentException.
valueAny—The value to store; one that cannot be converted to the element type throws System.InvalidCastException.
index1Integer—The index along the first dimension.
index2Integer—The index along the second dimension.
index3Integer—The index along the third dimension; an index outside its dimension throws System.IndexOutOfRangeException.

Overload 5 of 8

Signature
SetValue
    array: Array
    value: Any
    index1: Integer
    index2: Integer
void SetValue(Array array, object value, int index1, int index2)

Writes a value into a two-dimensional array at a row and column.

Parameters

nametypedefaultdescription
arrayArray—The two-dimensional array to write; any other dimension count throws System.ArgumentException.
valueAny—The value to store; one that cannot be converted to the element type throws System.InvalidCastException.
index1Integer—The index along the first dimension (row).
index2Integer—The index along the second dimension (column); an index outside its dimension throws System.IndexOutOfRangeException.

Overload 6 of 8

Signature
SetValue(array: Array, value: Any, index: Integer)
void SetValue(Array array, object value, int index)

Writes a value into a one-dimensional array of any element type at the given position.

Parameters

nametypedefaultdescription
arrayArray—The one-dimensional array to write; any other dimension count throws System.ArgumentException.
valueAny—The value to store; one that cannot be converted to the element type throws System.InvalidCastException.
indexInteger—The position to write; outside the array throws System.IndexOutOfRangeException.

Overload 7 of 8

Signature
SetValue(array: Array, value: Any, indices: Large Integer Array)
void SetValue(Array array, object value, params long[] indices)

Writes a value at a position given as one 64-bit index per dimension, for arrays of any dimension count.

Parameters

nametypedefaultdescription
arrayArray—The array to write.
valueAny—The value to store; one that cannot be converted to the element type throws System.InvalidCastException.
indicesLarge Integer Array—One index per dimension; a count different from the array's dimension count throws System.ArgumentException, and an index beyond the 32-bit range throws System.ArgumentOutOfRangeException, and one outside its dimension throws System.IndexOutOfRangeException.

Overload 8 of 8

Signature
SetValue
    array: Array
    value: Any
    index1: Large Integer
    index2: Large Integer
    index3: Large Integer
void SetValue(
    Array array,
    object value,
    long index1,
    long index2,
    long index3)

Writes a value into a three-dimensional array at a position given as 64-bit indices.

Parameters

nametypedefaultdescription
arrayArray—The three-dimensional array to write; any other dimension count throws System.ArgumentException.
valueAny—The value to store; one that cannot be converted to the element type throws System.InvalidCastException.
index1Large Integer—The index along the first dimension.
index2Large Integer—The index along the second dimension.
index3Large Integer—The index along the third dimension; an index beyond the 32-bit range throws System.ArgumentOutOfRangeException, and one outside its dimension throws System.IndexOutOfRangeException.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Sort

Function

Overload 1 of 17

Signature
Sort
    array: T Array
    index: Integer
    length: Integer
    comparer: IComparer<T>
void Sort(
    T[] array,
    int index,
    int length,
    IComparer<T> comparer)

Sorts a run of elements in place using the given comparer, leaving the rest of the array as it was.

Parameters

nametypedefaultdescription
arrayT Array—The array to sort; null throws System.ArgumentNullException.
indexInteger—The index of the first element of the run.
lengthInteger—How many elements the run covers.
comparerIComparer<T>—The ordering to sort by; null uses the elements' default ordering, which throws System.InvalidOperationException if the elements are not comparable.

Remarks

The sort is not stable: elements that compare equal may change order. A negative index or length throws System.ArgumentOutOfRangeException, and a run past the end throws System.ArgumentException.

Overload 2 of 17

Signature
Sort(keys: Array, items: Array)
void Sort(Array keys, Array items)

Sorts one array of keys in ascending order and rearranges a second array the same way, so each item stays paired with its key; use it to sort names by their scores, for example.

Parameters

nametypedefaultdescription
keysArray—The one-dimensional array of keys to sort by; null throws System.ArgumentNullException.
itemsArray—The array rearranged alongside the keys; null sorts only the keys, and an array shorter than the keys throws System.ArgumentException.

Remarks

The sort is not stable. Keys that are not comparable throw System.InvalidOperationException; either array being multidimensional throws System.RankException.

Overload 3 of 17

Signature
Sort(keys: Array, items: Array, comparer: IComparer)
void Sort(Array keys, Array items, IComparer comparer)

Sorts one array of keys using the given comparer and rearranges a second array the same way, so each item stays paired with its key.

Parameters

nametypedefaultdescription
keysArray—The one-dimensional array of keys to sort by; null throws System.ArgumentNullException.
itemsArray—The array rearranged alongside the keys; null sorts only the keys, and an array shorter than the keys throws System.ArgumentException.
comparerIComparer—The ordering of the keys; null uses the keys' default ordering.

Remarks

The sort is not stable. Either array being multidimensional throws System.RankException.

Overload 4 of 17

Signature
Sort(keys: Array, items: Array, index: Integer, length: Integer)
void Sort(Array keys, Array items, int index, int length)

Sorts a run of keys in ascending order and rearranges the matching run of a second array the same way, so each item stays paired with its key.

Parameters

nametypedefaultdescription
keysArray—The one-dimensional array of keys to sort by; null throws System.ArgumentNullException.
itemsArray—The array rearranged alongside the keys; null sorts only the keys.
indexInteger—The index of the first element of the run.
lengthInteger—How many elements the run covers.

Remarks

The sort is not stable. A negative index or length throws System.ArgumentOutOfRangeException, and a run past the end of either array throws System.ArgumentException.

Overload 5 of 17

Signature
Sort
    keys: Array
    items: Array
    index: Integer
    length: Integer
    comparer: IComparer
void Sort(
    Array keys,
    Array items,
    int index,
    int length,
    IComparer comparer)

Sorts a run of keys using the given comparer and rearranges the matching run of a second array the same way, so each item stays paired with its key.

Parameters

nametypedefaultdescription
keysArray—The one-dimensional array of keys to sort by; null throws System.ArgumentNullException.
itemsArray—The array rearranged alongside the keys; null sorts only the keys.
indexInteger—The index of the first element of the run.
lengthInteger—How many elements the run covers.
comparerIComparer—The ordering of the keys; null uses the keys' default ordering.

Remarks

The sort is not stable. A negative index or length throws System.ArgumentOutOfRangeException, and a run past the end of either array throws System.ArgumentException.

Overload 6 of 17

Signature
Sort(array: Array, comparer: IComparer)
void Sort(Array array, IComparer comparer)

Sorts a one-dimensional array of any element type in place using the given comparer.

Parameters

nametypedefaultdescription
arrayArray—The one-dimensional array to sort; null throws System.ArgumentNullException, and a multidimensional array throws System.RankException.
comparerIComparer—The ordering to sort by; null uses the elements' default ordering, which throws System.InvalidOperationException if the elements are not comparable.

Remarks

The sort is not stable: elements that compare equal may change order.

Overload 7 of 17

Signature
Sort(array: Array, index: Integer, length: Integer)
void Sort(Array array, int index, int length)

Sorts a run of elements of a one-dimensional array of any element type in place, in ascending order.

Parameters

nametypedefaultdescription
arrayArray—The one-dimensional array to sort; null throws System.ArgumentNullException, and a multidimensional array throws System.RankException.
indexInteger—The index of the first element of the run.
lengthInteger—How many elements the run covers.

Remarks

The sort is not stable. A negative index or length throws System.ArgumentOutOfRangeException, a run past the end throws System.ArgumentException, and elements that are not comparable throw System.InvalidOperationException.

Overload 8 of 17

Signature
Sort(array: T Array, comparison: Comparison<T>)
void Sort(T[] array, Comparison<T> comparison)

Sorts the whole array in place using a comparison function, for orderings such as by length or descending.

Parameters

nametypedefaultdescription
arrayT Array—The array to sort; null throws System.ArgumentNullException.
comparisonComparison<T>—The function that orders two elements; null throws System.ArgumentNullException.

Remarks

The comparison returns a negative number when the first argument comes first, 0 when they are equal and a positive number when the second comes first. The sort is not stable.

Overload 9 of 17

Signature
Sort
    array: Array
    index: Integer
    length: Integer
    comparer: IComparer
void Sort(
    Array array,
    int index,
    int length,
    IComparer comparer)

Sorts a run of elements of a one-dimensional array of any element type in place, using the given comparer.

Parameters

nametypedefaultdescription
arrayArray—The one-dimensional array to sort; null throws System.ArgumentNullException, and a multidimensional array throws System.RankException.
indexInteger—The index of the first element of the run.
lengthInteger—How many elements the run covers.
comparerIComparer—The ordering to sort by; null uses the elements' default ordering.

Remarks

The sort is not stable. A negative index or length throws System.ArgumentOutOfRangeException, and a run past the end throws System.ArgumentException.

Overload 10 of 17

Signature
Sort(array: T Array, index: Integer, length: Integer)
void Sort(T[] array, int index, int length)

Sorts a run of elements in place in ascending order, leaving the rest of the array as it was.

Parameters

nametypedefaultdescription
arrayT Array—The array to sort; null throws System.ArgumentNullException.
indexInteger—The index of the first element of the run.
lengthInteger—How many elements the run covers.

Remarks

The sort is not stable. A negative index or length throws System.ArgumentOutOfRangeException, a run past the end throws System.ArgumentException, and elements that are not comparable throw System.InvalidOperationException.

Overload 11 of 17

Signature
Sort(array: Array)
void Sort(Array array)

Sorts a one-dimensional array of any element type in place, in ascending order.

Parameters

nametypedefaultdescription
arrayArray—The one-dimensional array to sort; null throws System.ArgumentNullException, and a multidimensional array throws System.RankException.

Remarks

The sort is not stable. Elements that are not comparable throw System.InvalidOperationException.

Overload 12 of 17

Signature
Sort(keys: TKey Array, items: TValue Array)
void Sort(TKey[] keys, TValue[] items)

Sorts an array of keys in ascending order and rearranges a second array the same way, so each item stays paired with its key; use it to sort names by their scores, for example.

Parameters

nametypedefaultdescription
keysTKey Array—The keys to sort by; null throws System.ArgumentNullException.
itemsTValue Array—The array rearranged alongside the keys; null sorts only the keys, and an array shorter than the keys throws System.ArgumentException.

Remarks

The sort is not stable. Keys that are not comparable throw System.InvalidOperationException.

Overload 13 of 17

Signature
Sort(array: T Array, comparer: IComparer<T>)
void Sort(T[] array, IComparer<T> comparer)

Sorts the whole array in place using the given comparer.

Parameters

nametypedefaultdescription
arrayT Array—The array to sort; null throws System.ArgumentNullException.
comparerIComparer<T>—The ordering to sort by; null uses the elements' default ordering, which throws System.InvalidOperationException if the elements are not comparable.

Remarks

The sort is not stable: elements that compare equal may change order.

Overload 14 of 17

Signature
Sort
    keys: TKey Array
    items: TValue Array
    index: Integer
    length: Integer
void Sort(TKey[] keys, TValue[] items, int index, int length)

Sorts a run of keys in ascending order and rearranges the matching run of a second array the same way, so each item stays paired with its key.

Parameters

nametypedefaultdescription
keysTKey Array—The keys to sort by; null throws System.ArgumentNullException.
itemsTValue Array—The array rearranged alongside the keys; null sorts only the keys.
indexInteger—The index of the first element of the run.
lengthInteger—How many elements the run covers.

Remarks

The sort is not stable. A negative index or length throws System.ArgumentOutOfRangeException, and a run past the end of either array throws System.ArgumentException.

Overload 15 of 17

Signature
Sort
    keys: TKey Array
    items: TValue Array
    index: Integer
    length: Integer
    comparer: IComparer<TKey>
void Sort(
    TKey[] keys,
    TValue[] items,
    int index,
    int length,
    IComparer<TKey> comparer)

Sorts a run of keys using the given comparer and rearranges the matching run of a second array the same way, so each item stays paired with its key.

Parameters

nametypedefaultdescription
keysTKey Array—The keys to sort by; null throws System.ArgumentNullException.
itemsTValue Array—The array rearranged alongside the keys; null sorts only the keys.
indexInteger—The index of the first element of the run.
lengthInteger—How many elements the run covers.
comparerIComparer<TKey>—The ordering of the keys; null uses the keys' default ordering.

Remarks

The sort is not stable. A negative index or length throws System.ArgumentOutOfRangeException, and a run past the end of either array throws System.ArgumentException.

Overload 16 of 17

Signature
Sort(array: T Array)
void Sort(T[] array)

Sorts the whole array in place in ascending order: numbers smallest first, text alphabetically.

Parameters

nametypedefaultdescription
arrayT Array—The array to sort; null throws System.ArgumentNullException.

Remarks

The sort is not stable. Elements that are not comparable throw System.InvalidOperationException.

Overload 17 of 17

Signature
Sort
    keys: TKey Array
    items: TValue Array
    comparer: IComparer<TKey>
void Sort(TKey[] keys, TValue[] items, IComparer<TKey> comparer)

Sorts an array of keys using the given comparer and rearranges a second array the same way, so each item stays paired with its key.

Parameters

nametypedefaultdescription
keysTKey Array—The keys to sort by; null throws System.ArgumentNullException.
itemsTValue Array—The array rearranged alongside the keys; null sorts only the keys, and an array shorter than the keys throws System.ArgumentException.
comparerIComparer<TKey>—The ordering of the keys; null uses the keys' default ordering.

Remarks

The sort is not stable.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

Sync Root

Function

The object to lock on when several threads share this array; for an ordinary array it is the array itself.

Signature
SyncRoot(array: Array) -> Any
object SyncRoot(Array array)

Parameters

nametypedefaultdescription
arrayArray—The array whose lock object is wanted.

Returns

resultAny
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library

True For All

Function

Whether every element passes a test, for questions such as "are all values positive?".

Signature
TrueForAll(array: T Array, match: Predicate<T>) -> Truth
bool TrueForAll(T[] array, Predicate<T> match)

Parameters

nametypedefaultdescription
arrayT Array—The array to check; null throws System.ArgumentNullException.
matchPredicate<T>—The test applied to each element; null throws System.ArgumentNullException.

Returns

resultTruth
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Array Routines
Package
Standard Library