truespace 7.5 alpha10 notes

original source – printed emails from tS beta testing, processed with FreeOCR from http://www.paperfile.net/

Defined set of general purpose array data objects for scripting:
Universal Array Data.
Int Array Data.
Number Array Data.
String Array Data.
Boolean Array Data.
All are defined in Common Data package.
You can create single-dimensional as well as multidimensional arrays using these data objects.
Universal Array Data can store items of any type (primitives like int, bool, or rosetta data types), but it is slower and more memory consuming than specialized types (e.g. Int Array Data), so choose the right type carefully.
Samples
// Create simple array by adding items
a = System.CreateDO(“Common Data Package\Universal Array Data”);
a.Add(“first string”);
a.Add(“second string”);
a.Add(6.56);
// Create 2 dimensional integer array
a = System.CreateDO(“Common Data Package\Int Array Data”)
a.SetDim(2);
a.SetSize(10, 10);
for (i = O; i < 10; i++)
for (j = 0;j<10;j++)
a.SetAt(i,j, 50);

Leave a Reply