Data Structures

Data structures are ways of organizing memory so that large amounts of data can be managed efficiently. Usually, efficient data structures are a key in designing efficient algorithms. Basic has several of the most common data structures built in and ready to be used. The following functions create those data structures.






To make things easy, all the built in data structures are controlled by six commands and functions.

Put structure, variable {,index | key$}

Get structure, variable {,index | key$}

- Put and Get a variable to and from a data structure.

The first parameter, structure, is an object variable that points to the data structure. This structure is returned by one of the create functions listed above.

The second parameter may be any type of variable. Expressions are not allowed in the second parameter, only whole variables.

The third parameter varies depending on which type of data structure is being used (see the create functions above).

Remove structure, variable {,index | key$}

- This command works like a get, but the variable is removed from the data structure afterwards.

size = getSize(structure)

- Returns the current number of elements in the given data structure.

type = getType(structure{,index | key$})

- Returns the type of variable at the given position. This functions can always be used to determine if an element exists in a data structure.

0 = variable does not exist.
1 = numeric variable
2 = numeric array
3 = reserved
4 = reserved
5 = string variable
6 = string array
7 = Object Variable
8 = Object Array

objType = getObjType(structure{,index | key$})

- Returns the type of object variable at the given position.

0 = Variable is not an object or does not exist

1 = SQL Cursor
2 = Bitmap

3 = Matrix Cholesky Decomposition
4 = Matrix Eigenvalue Decomposition
5 = Matrix LU Decomposition
6 = Matrix QR Decomposition
7 = Matrix Singular Value Decomposition

8 = ArrayList
9 = HashTable
10 = Queue
11 = SparseArray
12 = Stack

13 = Gen Tileset
14 = Gen Tile Atlas
15 = Gen Sprite
16 = Gen Font
17 = Gen Text
18 = Gen Background

Become a Patron