Adding Unit Scope Names for Your Own Components

From RAD Studio
Jump to: navigation, search

Go Up to Unit Scope Names


If you create your own components, you can add unit scope names for new and existing projects.

To add unit scope names to new and existing projects (Recommended)

In general, component writers do not need to provide a unit scope name for their components because the added uses entry is automatically scoped. However, if you create your own components, you can add unit scope names in new and existing projects by following the steps below. You can also remove the unit scope names if the names are no longer needed.

  1. Locate the Registry key HKEY_CURRENT_USER\Software\Embarcadero\BDS\22.0\Library\libname, where libname is your supported target platform (one of Win32, Win64, OSX32, Android32, iOSDevice32, iOSDevice64, iOSSimulator).
  2. In the Library directory for your supported target platform (libname), create the following key: CompatibilityUnitScopes
  3. Add a string value:
    • Value Name = vendorname, where vendorname is the name of your component development enterprise
    • Value Data = unitscopenames, where unit scope names are delimited by semicolons

For example, the following Registry entry adds three compatibility unit scope names (NewComp, OldComp, and MyComp) for the vendor MyComponentCompany (Win32 platform):

HKEY_CURRENT_USER\Software\Embarcadero\BDS\22.0\Library\Win32\CompatibilityUnitScopes
MyComponentCompany=MyComp;NewComp;OldComp

The preceding procedure is RECOMMENDED because the unit scope names can be removed if the names are not needed.

To add unit scope names to every project, regardless of state

This procedure is NOT RECOMMENDED: It will increase compile times for all projects, even ones that do not require the namespace prefix (unit scope name).

  1. Read registry Key = "HKEY_CURRENT_USER\Software\Embarcadero\BDS\22.0\Library\<PlatformKey>\Namespace Search Path", where <PlatformKey> = [Win32, Win64, OSX32, Android32, iOSDevice32, iOSDevice64, iOSSimulator].
  2. Append unit scope names using a semicolon as a delimiter.
  3. Set the registry value "Namespace Search Path".

See Also