The Registry object provides access to the system registry.
The system registry houses all configuration for Carapace and for a vast number
of other systems.
The system registry is simply a hierarchical database -- at the top level are a set of hives. Each hive then consists of sections and attributes. Each attribute can have a value. In addition, a section can itself have a default value. Every value has a type -- the most common being string and integer values.
Using a Carapace Registry object you can traverse the registry,
accessing data as required.
The complete list of hive names is as follows:
| name | description |
|---|---|
ClassesRoot |
information on COM classes and servers |
CurrentUser |
information particular to the user who is currently logged on |
LocalMachine |
information common to the entire machine -- ie. independent of particular users |
Users |
information about users |
CurrentConfig |
current configuration information |
DynamicData |
dynamic or performance-related information |
The create function is used to create a Registry
object. The first way is to supply the desired section underneath the
HKEY_CURRENT_USER hive:
(create Registry "software/Carapace")
The above example gains you access to the software/Carapace section, which
holds the Carapace configuration.
An explicit hive name can be supplied eg.
(create Registry "software/Carapace" "LocalMachine")
| property name | property type | description |
|---|---|---|
hive |
String | name of the current registry hive |
section |
String | name of the current registry section |
| method name | description |
|---|---|
set |
set the value for an attribute within the current section |
get |
get the value for an attribute within the current section |
sections |
list the sub-sections of the current section |
attributes |
list the attributes in the current section |
values |
fill the supplied HashTable with the attributes and values from the current section |
createSection |
create a sub-section within the current section |
deleteSection |
delete a sub-section within the current section |
moveTo |
move to a different section |
moveUp |
move up to the parent section |
attributeExists |
determine if such an attribute exists in the current section |
sectionExists |
determine if such a sub-section exists in the current section |
setSet the value for an attribute within the current section. If the supplied attribute name is the empty string, then the default value for the section is assigned.
Arguments:
| attribute | String |
| value | Object |
Return type: the empty List ()
get
Get the value for an attribute within the current section.
If there is no such attribute, the empty
List () is returned.
Arguments:
| attribute | String |
Return type: Object
sectionsList the sub-sections of the current section.
Arguments: none
attributesList the attributes in the current section.
Arguments: none
valuesFill the supplied HashTable with the attributes and values from the current section.
Arguments:
| tbl | HashTable |
Return type: the empty List ()
createSectionCreate a sub-section within the current section.
Arguments:
| sectionName | String |
Return type: the empty List ()
deleteSectionDelete a sub-section within the current section.
Arguments:
| sectionName | String |
Return type: the empty List ()
moveToMove to the named section.
Arguments:
| sectionName | String |
Return type: the empty List ()
moveUpMove up to the parent section.
Arguments: none
Return type: the empty List ()
attributeExistsDetermine if such an attribute exists in the current section.
Arguments:
| attributeName | String |
Return type: the Symbol true
or the empty List ()
sectionExistsDetermine if such a sub-section exists in the current section.
Arguments:
| sectionName | String |
Return type: the Symbol true
or the empty List ()
| Contents | Index | Current topic: objects | Related links: built-in objects |