GET_DEFAULT
Returns the value of an X resource from the X resources database.
Syntax
string3 := GET_DEFAULT (string1, string2)
Parameters
string1 The name of the resource whose value you want
GET_DEFAULT to fetch.
string2 The class of the resource.
string3 The string equivalent of the resource value. Note
that the application must convert the string to
the data type appropriate to the resource, if such
conversion is necessary.
Example
If you want to create an extension of EVE that enables use of an X
defaults file to choose a keypad setting, you can use a GET_DEFAULT
statement in a module_init procedure. For more information about
extending EVE using a module_init procedure and the EVE$BUILD tool, see
the DEC Text Processing Utility Manual.
The following code fragment shows the portion of a module_init
procedure directing DECTPU to fetch the value of a resource from the X
resources database.
PROCEDURE application_module_init
LOCAL
keypad_name;
:
:
:
keypad_name := GET_DEFAULT ("user.keypad", "User.Keypad");
EDIT (keypad_name, UPPER); ! Convert the returned string to uppercase.
IF keypad_name <> '0'
THEN
CASE keypad_name
"EDT" : eve_set_keypad_edt ();
"NOEDT" : eve_set_keypad_noedt ();
"WPS" : eve_set_keypad_wps ();
"NOWPS" : eve_set_keypad_nowps ();
"NUMERIC" : eve_set_keypad_numeric ();
"VT100" : eve_set_keypad_vt100 ();
[INRANGE, OUTRANGE] : eve_set_keypad_numeric;
ENDCASE;
ENDIF;
:
:
:
ENDPROCEDURE;