Consultor Eletrônico



Kbase 13685: How PUT-KEY-VALUE and GET-KEY-VALUE work on Motif platforms
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/05/1998
How PUT-KEY-VALUE and GET-KEY-VALUE work on Motif platforms


On Motif, the PUT-KEY-VALUE and GET-KEY-VALUE functions are restricted
in how they can be used. These restrictions are partly due to the
fact that PUT-KEY-VALUE and GET-KEY-VALUE were originally used on
DOS/MS-Windows platforms, where the .INI file has separate sections
and keys. On Motif, the .Xdefaults file does not have any counterpart
for a "section", nor is there a "key".

The syntax for PUT-KEY-VALUE is:

PUT-KEY-VALUE SECTION <section> KEY <key> VALUE <value>.

The <value> is a character string or character variable.

For Motif, the SECTION is left empty and for KEY we use the X resource
name that is being changed. For example:

PUT-KEY-VALUE SECTION "" KEY "ProeditSaveSettings" VALUE "yes".


This adds the following line to the .Xdefaults file in the user's
home directory:

_promtf.ProeditSaveSettings: yes

Note the following:

(a) The resource file used is .Xdefaults in the user's home directory.

(b) The application name given is _promtf, which is the name for the
Progress executable on Motif.

(c) The "." is used as a separator between the application name and
the resource name. A "*" is not possible.

The use of GET-KEY-VALUE is similar:

DEF VAR res_name AS CHAR.
GET-KEY-VALUE SECTION "" KEY "ProeditSaveSettings" VALUE res_name.
MESSAGE res_name.

In this example, the variable res_name will get the "yes" setting from
.Xdefaults for the resource "_promtf.ProeditSaveSettings".

Progress Software Technical Support Note # 13685