Player APIs (BrightScript & Ja...
...
Object Reference
BrightScript Core Objects

roArray

12min
this object stores objects in a continuous array of memory locations since an roarray contains brightscript components, and there are object wrappers for most intrinsic data types, entries can either be different types or all of the same type object creation the roarray object is created with two parameters createobject("roarray", size as integer, resize as boolean) size the initial number of entries allocated for the array resize if true, the array will be resized larger to accommodate more entries if needed if the array is large, this process might take some time the program statements docid\ xjncz5p2xsv5j9geofi13 statement may be used instead of the createobject() function to create a new array the dim statement can be advantageous because it automatically creates array of array structures for multi dimensional arrays ifarray peek() as dynamic returns the last (highest index) array entry without removing it pop() as dynamic returns the last (highest index) entry and removes it from the array push(entry as dynamic) adds a new highest index entry to the end of the array shift() as dynamic removes index zero from the array and shifts all other entries down by one unit unshift(entry as dynamic) adds a new index zero to the array and shifts all other entries up by one unit delete(index as integer) as boolean deletes the indicated array entry and shifts all above entries down by one unit count() as integer returns the length of the array (i e the index of the highest entry in the array plus one) clear() deletes every entry in the array append(array as roarray) appends one roarray to another if the passed roarray contains entries that were never set to a value, they are not appended the two appended objects must be of the same type ifenum reset() resets the position to the first element of enumeration next() as dynamic returns a typed value at the current position and increments the position isnext() as boolean returns true if there is a next element isempty() as boolean returns true if there is not an exact statement ifarrayget getentry(index as integer) as dynamic returns an array entry of a given index entries start at zero if the entry at the specified index has not been set, this method will return invalid ifarrayset setentry(a as integer, b as dynamic) sets an entry of a given index to the passed type value