Skip to content

Set_Registry_Root

Obsolete

This command is obsolete. Use the cRegistry class for accessing the Windows Registry in DataFlex.

Purpose

To change the registry root and branch used by the profile-string getting and setting commands.

Syntax

set_registry_root to root branch

Argument Explanation

  • root: The name of a root in the Windows registry. This may be one of the following values:
  • HKEY_CLASSES_ROOT: COM class and file type information. Sub-tree of HKEY_LOCAL_MACHINE.
  • HKEY_CURRENT_USER: Sub-tree of HKEY_USERS which corresponds to the information about the current user. This is where user-specific information for an application can be stored.
  • HKEY_LOCAL_MACHINE: This is where all global (not user-specific) machine information is stored. This tree contains the Software branch where most applications store their global information. This is the default setting for DataFlex.
  • HKEY_USERS: This is where all user-specific information is stored. The sub-tree for the current user is better accessed through HKEY_CURRENT_USER.
  • HKEY_PERFORMANCE_DATA: Not generally used by applications.
  • HKEY_CURRENT_CONFIG: Not generally used by applications.
  • HKEY_DYN_DATA: Not generally used by applications.

  • branch: The name of a branch under root in the Windows registry.

What It Does

This command sets the default root and branch (top two keys) of the Windows registry to access control panel settings for the current user.

Set_Registry_Root TO HKEY_CURRENT_USER "Control Panel"
get_foreign_profile_string "International" "" "sShortDate" to sValData
showln "The short date format is " sValData

In this example, the registry access root and branch are changed to, respectively, HKEY_CURRENT_USER and "Control Panel". Then, get_foreign_profile_string is used to return the short date format setting as defined in the date settings of the control panel.

Whenever a branch does not exist, set_foreign_profile_string will create the necessary access members (keys and values) the first time a registry value is written with set_foreign_profile_string.

The default DataFlex root and branch are used by the get_profile_string, set_profile_string, get_foreign_profile_string, and set_foreign_profile_string commands.