beautypg.com

Roassociativearray – BrightSign Object Reference Manual (FW 5.1) User Manual

Page 16

background image

8

roAssociativeArray

An associative array (also known as a map, dictionary, or hash table) that allows objects to be associated with string keys.

This object is created with no parameters:

CreateObject("roAssociativeArray")

Interfaces:

ifEnum

,

ifAssociativeArray


The ifEnum interface provides the following:

Reset(): Resets the position to the first element of enumeration.

Next() As Dynamic: Returns the 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 a next element.


The ifAssociativeArray interface provides the following:

AddReplace(key As String, value As Object) As Void: Adds a new entry to the array, associating the
supplied object with the supplied string. Only one object may be associated with a string, so any existing object is
discarded.

Lookup(key As String) As Object: Looks for an object in the array associated with the specified string. If
there is no object associated with the string, then this method will return Invalid.

DoesExist(key As String) As Boolean: Looks for an object in the array associated with the specified
string. If there is no associated object, then False is returned. If there is such an object, then True is returned.

Delete(key As String) As Boolean: Looks for an object in the array associated with the specified string. If
there is such an object, then it is deleted and True is returned. If not, then False is returned.

Clear As Void: Removes all objects from the associative array.