SparseArray


sparsearray = CreateSparseArray({copySparseArray})

This function returns an object reference that points to a sparse array. An existing sparse array may be copied by placing it as the optional parameter copySparseArray.

An array in which large number of elements are empty (do not exist) is referred to as being sparse.


sparsearray = CreateSparseArray()

n = 1
put sparsearray, n, 100


Index

Value

100

1



n = 2
put sparsearray, n, 200


Index

Value

100

1

200

2



n = 3
put sparsearray, n, 300


Index

Value

100

1

200

2

300

3



The getType() function can be used to determine if a given index in the sparse array exists.

if getType(sparsearray, 100) then
get sparsearray, a, 100
endif



Data Structures







Become a Patron