Release 10.1A: OpenEdge Development:
Programming Interfaces

> ## 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, you might enter this statement. It returns the initial environment definition for font 8 in the FontString variable:

>     DEFINE VARIABLE FontString AS CHARACTER FORMAT "x(128)".
>     GET-KEY-VALUE SECTION "Fonts" KEY "Font8" VALUE FontString.

> To specify “Times New Roman” as the new definition for font 8 on Windows, you might enter this statement. It 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

> To write portable color and font definitions directly from the current color and font tables, use the `PUT–KEY–VALUE` statement with the `COLOR` or `FONT` option. For example, if you allow the user to change color 8 during a session through the color common dialog (`SYSTEM–DIALOG COLOR` statement), you can save the new color definition in the current environment using this statement:

>     PUT-KEY-VALUE COLOR 8.

> You can save all current color definitions from the color table using this statement:

>     PUT-KEY-VALUE COLOR ALL.

> For more information on these statements, see the OpenEdge Development: Progress 4GL Reference .

Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095