Adding Unit Scope Names for Your Own Components
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.
- Locate the Registry key
HKEY_CURRENT_USER\Software\Embarcadero\BDS\21.0\Library\libname, where libname is your supported target platform (one of Win32, Win64, OSX32, Android32, iOSDevice32, iOSDevice64, iOSSimulator).
- In the Library directory for your supported target platform (libname), create the following key:
- 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):
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).
- Read registry Key = "HKEY_CURRENT_USER\Software\Embarcadero\BDS\21.0\Library\<PlatformKey>\Namespace Search Path", where <PlatformKey> = [Win32, Win64, OSX32, Android32, iOSDevice32, iOSDevice64, iOSSimulator].
- Append unit scope names using a semicolon as a delimiter.
- Set the registry value "Namespace Search Path".