C# Класс LitDev.LDArray

Показать файл Открыть проект

Открытые методы

Метод Описание
Copy ( Primitive array1, Primitive array2 ) : Primitive

Copy one array to another array. The dimensions of the 2 arrays must be the same.

CopyNew ( Primitive array ) : Primitive

Copy one array to a new array.

CopyToSBArray ( Primitive array ) : Primitive

Copy LDArray type to SmallBasic array type. The reverse operation (SmallBasic to LDArray) isn't possible becuase the SmallBasic indexes are not necessarily contiguous integers. Note also that a SmallBasic array cannot hold an empty string value, so these will not be copied.

Count ( Primitive array ) : Primitive

Get the number of non-empty "" elements in the array.

Create ( Primitive maxSize ) : Primitive

Create a new array (can be used for numbers or character strings).

CreateFromIndices ( Primitive sbArray ) : Primitive

Create a new array from the indices of a Small Basic array.

CreateFromValues ( Primitive sbArray ) : Primitive

Create a new array from the values of a Small Basic array.

Delete ( Primitive array ) : Primitive

Delete an existing array (not generally required, but can save memory if lots of arrays are created).

GetIndex ( Primitive sbArray, Primitive value ) : Primitive

Get the index of the first occurance of a value in an SB array.

GetValue ( Primitive array, Primitive index ) : Primitive

Get value in array.

Load ( Primitive array, Primitive fileName ) : Primitive

Load an array from a file.

Save ( Primitive array, Primitive fileName ) : Primitive

Save an array to a file.

Search ( Primitive array, Primitive searchstring, Primitive match ) : Primitive

Obtain an array of the indices that have values that contain searchstring. The search is case in-sensitive. The input array is unchanged and the match array must be previously created with the same size as the array to check.

SetValue ( Primitive array, Primitive index, Primitive value ) : Primitive

Set value in array.

Sort ( Primitive array ) : Primitive

Perform a sort on an LDArray. By default the sort is by string value, therefore 10 comes before 2. To sort by number value, all values must be a number (or empty). Empty values are placed at the end of the sort. The input array is replaced by the sorted array.

SortIndex ( Primitive array, Primitive index ) : Primitive

Obtain an array of the indices in sort order of an array. By default the sort is by string value, therefore 10 comes before 2. To sort by number value, all values must be a number (or empty). Empty values are placed at the end of the sort. The input array is unchanged and the index array must be previously created with the same size as the array to sort.

getArray ( string name ) : Array

Приватные методы

Метод Описание
getNewNumber ( ) : int

Описание методов

Copy() публичный статический Метод

Copy one array to another array. The dimensions of the 2 arrays must be the same.
public static Copy ( Primitive array1, Primitive array2 ) : Primitive
array1 Primitive /// The array to copy from. ///
array2 Primitive /// The array to copy to. ///
Результат Primitive

CopyNew() публичный статический Метод

Copy one array to a new array.
public static CopyNew ( Primitive array ) : Primitive
array Primitive /// The array to copy. ///
Результат Primitive

CopyToSBArray() публичный статический Метод

Copy LDArray type to SmallBasic array type. The reverse operation (SmallBasic to LDArray) isn't possible becuase the SmallBasic indexes are not necessarily contiguous integers. Note also that a SmallBasic array cannot hold an empty string value, so these will not be copied.
public static CopyToSBArray ( Primitive array ) : Primitive
array Primitive /// The array name. ///
Результат Primitive

Count() публичный статический Метод

Get the number of non-empty "" elements in the array.
public static Count ( Primitive array ) : Primitive
array Primitive The array name.
Результат Primitive

Create() публичный статический Метод

Create a new array (can be used for numbers or character strings).
public static Create ( Primitive maxSize ) : Primitive
maxSize Primitive /// The maximum number of elements in the array. ///
Результат Primitive

CreateFromIndices() публичный статический Метод

Create a new array from the indices of a Small Basic array.
public static CreateFromIndices ( Primitive sbArray ) : Primitive
sbArray Primitive The SB array.
Результат Primitive

CreateFromValues() публичный статический Метод

Create a new array from the values of a Small Basic array.
public static CreateFromValues ( Primitive sbArray ) : Primitive
sbArray Primitive The SB array.
Результат Primitive

Delete() публичный статический Метод

Delete an existing array (not generally required, but can save memory if lots of arrays are created).
public static Delete ( Primitive array ) : Primitive
array Primitive /// The array name. ///
Результат Primitive

GetIndex() публичный статический Метод

Get the index of the first occurance of a value in an SB array.
public static GetIndex ( Primitive sbArray, Primitive value ) : Primitive
sbArray Primitive The SB array.
value Primitive The value to find.
Результат Primitive

GetValue() публичный статический Метод

Get value in array.
public static GetValue ( Primitive array, Primitive index ) : Primitive
array Primitive /// The array name. ///
index Primitive /// The index at which to get the value (indexed starting from 1). ///
Результат Primitive

Load() публичный статический Метод

Load an array from a file.
public static Load ( Primitive array, Primitive fileName ) : Primitive
array Primitive The array to load the data into. /// The array must already exist.
fileName Primitive The file path to load the array from.
Результат Primitive

Save() публичный статический Метод

Save an array to a file.
public static Save ( Primitive array, Primitive fileName ) : Primitive
array Primitive The array to save.
fileName Primitive The file path to save the file to.
Результат Primitive

Search() публичный статический Метод

Obtain an array of the indices that have values that contain searchstring. The search is case in-sensitive. The input array is unchanged and the match array must be previously created with the same size as the array to check.
public static Search ( Primitive array, Primitive searchstring, Primitive match ) : Primitive
array Primitive The array to check for matches.
searchstring Primitive The string to search for.
match Primitive An array to hold the index of matched values.
Результат Primitive

SetValue() публичный статический Метод

Set value in array.
public static SetValue ( Primitive array, Primitive index, Primitive value ) : Primitive
array Primitive /// The array name. ///
index Primitive /// The index at which to add the value (indexed starting from 1). ///
value Primitive /// The value. ///
Результат Primitive

Sort() публичный статический Метод

Perform a sort on an LDArray. By default the sort is by string value, therefore 10 comes before 2. To sort by number value, all values must be a number (or empty). Empty values are placed at the end of the sort. The input array is replaced by the sorted array.
public static Sort ( Primitive array ) : Primitive
array Primitive The array to sort.
Результат Primitive

SortIndex() публичный статический Метод

Obtain an array of the indices in sort order of an array. By default the sort is by string value, therefore 10 comes before 2. To sort by number value, all values must be a number (or empty). Empty values are placed at the end of the sort. The input array is unchanged and the index array must be previously created with the same size as the array to sort.
public static SortIndex ( Primitive array, Primitive index ) : Primitive
array Primitive The array to obtain an index order sort.
index Primitive An array to hold the index order of the sorted array.
Результат Primitive

getArray() публичный статический Метод

public static getArray ( string name ) : Array
name string
Результат Array