LitDev Extension API
LDFastArray
![](images/IntellisenseObject.png)
This object provides another faster way of storing values in an Array.
It can handle 1, 2, 3 and higher dimensional arrays and has methods to read and write arrays to files, including in CSV format.
It is also possible for different rows in an array to have different dimensions or numbers of elements (jagged array), just like Small Basic arrays.
Internally it uses lists that allow the sizes to grow so that the array dimension or size doesn't need to be set at the start.
The indexing is by integer starting from 1.
For 1D arrays it is recommended to use LDList since it has additional sort methods.
Elements in arrays with dimension greater than 3 are indexed by a comma separated list of indices or index variable names.
Add
![]() |
Collapse
![]() |
Copy
![]() |
CreateFromIndices
![]() |
CreateFromValues
![]() |
Dimension
![]() |
Get
![]() |
Get1D
![]() |
Get2D
![]() |
Get3D
![]() |
Read
![]() |
ReadCSV
![]() |
Remove
![]() |
Set
![]() |
Set1D
![]() |
Set2D
![]() |
Set3D
![]() |
Size
![]() |
Size1
![]() |
Size2
![]() |
Size3
![]() |
ToArray
![]() |
Write
![]() |
WriteCSV
![]() |
Add()
![](images/IntellisenseMethod.png)
Create a new array.
This is a general array that can be used as a 1D, 2D, 3D or higher dimension array, depending on the data set.
returns The array name.
Collapse(arrayName)
![](images/IntellisenseMethod.png)
Remove all empty "" entries in an array.
Note that indices or even dimensions may change if internal entries are removed.
arrayName The array name.
Copy(arrayName)
![](images/IntellisenseMethod.png)
Copy an array.
arrayName The array name.
returns A copy of the array.
CreateFromIndices(sbArray)
![](images/IntellisenseMethod.png)
Convert a SmallBasic array (up to 3 dimensions) to a FastArray array.
This method creates an array only containing the Small Basic array indices.
sbArray The Small Basic array.
returns A new FastArray or "".
CreateFromValues(sbArray)
![](images/IntellisenseMethod.png)
Convert a SmallBasic array to a FastArray array.
All indices in the Small Basic array are replaced with consecutive integer indices.
sbArray The Small Basic array.
returns A new FastArray or "".
Dimension(arrayName)
![](images/IntellisenseMethod.png)
Get the dimension of an array.
arrayName The array name.
returns The array dimension.
Get(arrayName,indices)
![](images/IntellisenseMethod.png)
Get a value.
Get1D, Get2D or Get3D methods are marginally faster for lower dimension arrays.
arrayName The array name.
indices A comma (or space) separated list of index values (slower) or index variable names (faster).
e.g. "3,2,6" or "i,j,k"
If this is set to "", then previously set index variables are used.
returns The array value or "" on failure.
Get1D(arrayName,index1)
![](images/IntellisenseMethod.png)
Get a 1D value.
arrayName The array name.
index1 The first dimension integer index.
returns The array value or "" on failure.
Get2D(arrayName,index1,index2)
![](images/IntellisenseMethod.png)
Get a 2D value.
arrayName The array name.
index1 The first dimension integer index.
index2 The second dimension integer index.
returns The array value or "" on failure.
Get3D(arrayName,index1,index2,index3)
![](images/IntellisenseMethod.png)
Get a 3D value.
arrayName The array name.
index1 The first dimension integer index.
index2 The second dimension integer index.
index3 The third dimension integer index.
returns The array value or "" on failure.
Read(fileName,binary)
![](images/IntellisenseMethod.png)
Create a new array and initialise it from a file.
If the file is text based and doesn't have the same indexing format as Write, then a 1D array with each line is created.
fileName The full path of the file.
binary Binary ("True") or text ("False") formatted file.
returns The array name.
ReadCSV(fileName)
![](images/IntellisenseMethod.png)
Read a CSV (comma separated values) file into a 2D FastArray array.
The deliminator may be changed from a comma using Utilities.CSVDeliminator
fileName The full path of the CSV file.
returns A 2D FastArray with CSV file imported or "".
Remove(arrayName)
![](images/IntellisenseMethod.png)
Delete an array.
arrayName The array name.
Set(arrayName,indices,value)
![](images/IntellisenseMethod.png)
Set a value.
Set1D, Set2D or Set3D methods are marginally faster for lower dimension arrays.
arrayName The array name.
indices A comma (or space) separated list of index values (slower) or index variable names (faster).
e.g. "3,2,6" or "i,j,k"
If this is set to "", then previously set index variables are used.
value The value to set.
Set1D(arrayName,index1,value)
![](images/IntellisenseMethod.png)
Set a 1D value.
arrayName The array name.
index1 The first dimension integer index.
value The value to set.
Set2D(arrayName,index1,index2,value)
![](images/IntellisenseMethod.png)
Set a 2D value.
arrayName The array name.
index1 The first dimension integer index.
index2 The second dimension integer index.
value The value to set.
Set3D(arrayName,index1,index2,index3,value)
![](images/IntellisenseMethod.png)
Set a 3D value.
arrayName The array name.
index1 The first dimension integer index.
index2 The second dimension integer index.
index3 The third dimension integer index.
value The value to set.
Size(arrayName,indices)
![](images/IntellisenseMethod.png)
Get the current size of a dimension.
Size1, Size2 or Size3 methods are marginally faster for lower dimension arrays.
arrayName The array name.
indices A comma (or space) separated list of indices.
e.g. "" for first dimension or "3" for second dimension of 3rd element in first dimension.
returns The dimension size.
Size1(arrayName)
![](images/IntellisenseMethod.png)
Get the current size of the first dimension.
arrayName The array name.
returns The dimension size.
Size2(arrayName,index1)
![](images/IntellisenseMethod.png)
Get the current size of the second dimension.
arrayName The array name.
index1 The first index to get the size of, may be 1 if all rows have the same size.
returns The dimension size.
Size3(arrayName,index1,index2)
![](images/IntellisenseMethod.png)
Get the current size of the third dimension.
arrayName The array name.
index1 The first index to get the size of, may be 1 if all rows have the same size.
index2 The second index to get the size of, may be 1 if all rows have the same size.
returns The dimension size.
ToArray(arrayName)
![](images/IntellisenseMethod.png)
Convert a FastArray array to a Small Basic array.
arrayName The array name.
returns A Small Basic array or "".
Write(arrayName,fileName,binary)
![](images/IntellisenseMethod.png)
Save an array to a file.
If the array is 1D and written as a text, then each entry is just written to a line with no indexing.
arrayName The array name.
fileName The full path of the file.
binary Binary ("True") or text ("False") formatted file.
WriteCSV(arrayName,fileName)
![](images/IntellisenseMethod.png)
Write a 2D FastArray array to a CSV (comma separated values) file.
The deliminator may be changed from a comma using Utilities.CSVDeliminator
arrayName The 2D array name.
fileName The full path of the CSV file.