beautypg.com

Roregistry (hd2000 only), Roregistrysection (hd2000 only) – BrightSign HD2000 Object Reference Manual User Manual

Page 33

background image

roRegistry (HD2000 only)

The registry is an area of memory where a small number of persistent settings can be stored. Access to the
registry is available through the roRegistry object.

This object is created with no parameters.
 CreateObject("roRegistry")

The following methods are supported:
 roList GetSectionList()

o

returns a list with one entry for each registry section.

 rotBOOL Delete(rotSTRING section)

o

deletes the specified section and returns an indication of success.

 rotBOOL Flush()

o

flushes the registry out to persistent storage.

roRegistrySection (HD2000 only)

A section of the registry, enabling the organization of settings within the registry.

This object must be supplied with a "section" name on creation.
 CreateObject("roRegistrySection", rotSTRING section)

The roRegistrySection object implements the ifRegistrySection interface. This interface provides:

 rotSTRING Read(rotSTRING key)

o

reads and returns the value of the specified key.

 rotBOOL Write(rotSTRING key, rotSTRING value)

o

replaces the value of the specified key.

 rotBOOL Delete(rotSTRING key)

o

deletes the specified key.

 rotBOOL Exists(rotSTRING key)

o

returns true if the specified key exists.

 rotBOOL Flush()

o

flushes the contents of the registry out to persistent storage.

 roList GetKeyList()

o

returns a list containing one entry per registry key in this section.



Example:
registrySection = CreateObject("roRegistrySection", "widget-usage")
' An empty entry will read as the null string and therefore be
converted to zero.
hits = val(registrySection.Read("big-red-button-hits"))
hits = hits + 1
registrySection.Write("big-red-button-hits", strI(hits))

Writes do not always take immediate effect to prevent the system from exceeding the maximum number of
writes on the I2C ROM. At most sixty seconds after a write to the registry it will automatically be written
out to persistent storage. If for some reason the change must be written immediately then one of the flush
functions should be called. Changes are automatically written prior to application exit.

33

This manual is related to the following products: