Try OpenEdge Now
skip to main content
Programming Interfaces
Input/Output Processes : Colors and Fonts : Retrieving and changing color and font definitions : Using GET-KEY-VALUE and PUT-KEY-VALUE
 
Using GET-KEY-VALUE and PUT-KEY-VALUE
The GET–KEY–VALUE and PUT–KEY–VALUE statements allow you to read or write a specified value for any resource by accessing 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 example, to retrieve the Windows definition for font 8 from the current environment, which might be the registry or an initialization file, use a statement that returns the initial environment definition for font 8 in the FontString variable. For example:
DEFINE VARIABLE FontString AS CHARACTER NO-UNDO FORMAT "x(128)".
GET-KEY-VALUE SECTION "Fonts" KEY "Font8" VALUE FontString.
To specify "Times New Roman" as the new definition for font 8 in Windows, you might enter this statement, which sets the font8 parameter in the current environment:
PUT-KEY-VALUE SECTION "fonts" KEY "font8" VALUE "Times New Roman".
* Writing portable color and font definitions