GET-KEY-VALUE statement
(Windows only)
Searches the current environment for a particular key and places its value into a particular data item.
Note: Does not apply to SpeedScript programming.Syntax
SECTIONsection-name
KEYkey-name
DEFAULT
Tells GET-KEY-VALUE to use the default key of sectionsection-name.
Some applications store data in the registry under the default key of a section. This option lets you retrieve this data. For an example, see the EXAMPLES section of this entry.This option applies only to the registry and not to initialization files.VALUEkey-value
ExamplesIf the current environment resides in the registry, the GET-KEY-VALUE statement:
If the current environment resides in an initialization file, the GET-KEY-VALUE statement:
If the current environment is the registry, the GET-KEY-VALUE statement:
If the current environment resides in an initialization file, the following example returns a comma-separated list of all section names in the initialization file:
If the current environment resides in the registry, the GET-KEY-VALUE statement:
If the current environment resides in an initialization file, the GET-KEY-VALUE statement:
If the current environment resides in the registry, the following examples return a comma-separated list of subkeys under the current environment location and all value names directly under the current environment location. The delimiter @value@ separates the subkey names from the value names.
If the current environment resides in an initialization file, the following examples return a comma-separated list of all section names in the initialization file:
If the current environment resides in the registry, the GET-KEY-VALUE statement:
If the current environment resides in an initialization file, the following example returns an error:
Notes
- Environments typically consist of sections, each of which can contain keys, each of which consists of a name and a value. A typical section name is COLORS. A typical key within this section consists of the name “COLOR16" and the value 255,255,0. This key attaches this particular name to this particular color. (The value represents a color specification using the red-green-blue color-naming scheme.)
The current environment might be the registry or an initialization file. The registry consists of sections called keys and subkeys arranged in a hierarchy. Keys and subkeys contain value entries, each of which consists of a value name and value data. Initialization files, by contrast, consist of a single level of sections. Sections contain entries, each of which consists of a name, an equals sign (=), and a value.For more information on environments, see the chapter on colors and fonts in OpenEdge Development: Programming Interfaces.- The current environment is either the default environment, the startup environment (an environment that a startup parameter specified), or an application environment that the LOAD statement loaded and that the USE statement made current.
- If you unload the current environment (using the UNLOAD statement) and then use the GET-KEY-VALUE statement, you access the startup environment.
See alsoLOAD statement, PUT-KEY-VALUE statement, UNLOAD statement, USE statement
OpenEdge Release 10.2B
|