REG_SET_VALUE, DISPLAY_REG_SET_VALUE

Associates a value with a specified registry key by accessing the Windows registry routine RegSetValue.
Note: This ACUCOBOL-GT library routine is available in this COBOL version. Any compatibility issues in this COBOL system are in the Compatibility Issues section at the end of the topic.

Use DISPLAY_REG_SET_VALUE to perform the action on the display host's registry (the local host when the application is run with a standard runtime; the thin client when the application is run with the thin client). Use REG_SET_VALUE to perform the action on the server host's registry (the local host when the application is run with a standard runtime, and the application host when the application is run with the thin client).

Usage

CALL "REG_SET_VALUE" 
    USING OPEN-KEY-HANDLE, VALUE,
    GIVING STATUS-CODE

or

CALL "REG_SET_VALUE"
    USING OPEN-KEY-HANDLE, VALUE, SUBKEY-NAME,
    GIVING STATUS-CODE

Parameters

OPEN-KEY-HANDLE Usage unsigned-long

Handle of a currently open key or one of the following predefined handles of keys that are always open (defined in acugui.def):
  • HKEY_CLASSES_ROOT
  • HKEY_CURRENT_USER
  • HKEY_LOCAL_MACHINE
  • HKEY_USERS
VALUE PIC X(n) String containing the value to set for the specified key.
SUBKEY-NAME PIC X(n) (optional) Name of a subkey of OPEN-KEY-HANDLE with which to associate a value. If there is no existing subkey matching the name specified, REG_SET_VALUE will first create it. If SUBKEY-NAME is omitted or contains an empty string, the specified value will be associated with the key identified by OPEN-KEY-HANDLE.
STATUS-CODE Numeric data item. Receives the return status of the call to Microsoft's RegSetValue function. A return status of zero indicates success; non-zero indicates that an error occurred.

Compatibility Issues

  • REG_SET_VALUE is a Windows-only routine.
  • DISPLAY_REG_SET_VALUE is not supported.
  • acugui.def is not supplied in this COBOL system.
  • Thin client technology is not supported in this COBOL system.