Like Variables Arrays can be assigned strings, integers, or floats without any datatype indicator. Arrays are created using the standard BASIC 'Dim ' statement, and any number of dimensions. For example:

Dim stack(100)
Dim matrix(3,3,3,3)
Dim table(100,24)

Linear Index

Arrays in BlitzScript3D share space on a single dimensioned array called the MasterArray. A unique linear index is provided for an array with any number number dimensions. Thus, accessing element matrix(1,2,0,3) is the same as accesing the linear element matrix(99).

The compiler generates several add and multiply instructions to calculate the linear index. These extra instructions can impact performance. To reduce the number of instructions generated you can acquire the linear index and use it to access elements in the array using (%) operator. The result is fewer instructions generated and processed for greater effeciency.


i=entity%(1,2) ;assigns the linear index to i

More About the Master Array

The Master Array has default maximum value of 65535 linear indexes. You can modify this value by modifying bscvmPrefs.bsc file.