Player APIs (BrightScript & Ja...
...
Object Reference
BrightScript Core Objects
roList
19min
this object functions as a general purpose, doubly linked list it can be used as a container for arbitrary length lists of brightsign objects the array operator \[ ] can be used to access any element in an ordered list iflist count() as integer returns the number of elements in the list resetindex() as boolean resets the current index or position in the list to the head element addtail(obj as object) as void adds a typed value to the tail of the list addhead(obj as object) as void adds a typed value to the head of the list removeindex() as object removes an entry from the list at the current index or position and increments the index or position in the list it returns invalid when the end of the list is reached getindex() as object retrieves an entry from the list at the current index or position and increments the index or position in the list it returns invalid when the end of the list is reached removetail() as object removes the entry at the tail of the list removehead() as object removes the entry at the head of the list gettail() as object retrieves the entry at the tail of the list and keeps the entry in the list gethead() as object retrieves the entry at the head of the list and keeps the entry in the list clear() removes all elements from the list ifenum reset() resets the position to the first element of enumeration next() as dynamic returns a typed value at the current position and increment position isnext() as boolean returns true if there is a next element isempty() as boolean returns true if there is not an exact statement ifarray peek() as dynamic returns the last (highest index) list entry without removing it pop() as dynamic returns the last (highest index) entry and removes it from the list push(entry as dynamic) adds a new highest index entry to the end of the list shift() as dynamic removes index zero from the list and shifts all other entries down by one unit unshift(entry as dynamic) adds a new index zero to the list and shifts all other entries up by one unit delete(index as integer) as boolean deletes the indicated list entry and shifts all above entries down by one unit count() as integer returns the length of the list (i e the index of the highest entry in the list plus one) clear() deletes every entry in the list append(list as rolist) appends one rolist to another if the passed rolist contains entries that were never set to a value, they are not appended the two appended objects must be of the same type ifarrayget getentry(a as integer) as dynamic returns a list entry of a given index entries start at zero if an entry that has not been set is fetched, invalid is returned ifarrayset setentry(a as integer, b as dynamic) sets an entry of a given index to the passed type value example list = createobject("rolist") list addtail("a") list addtail("b") list addtail("c") list addtail("d") list resetindex() x= list getindex() while x <> invalid print x x = list getindex() end while print list\[2]