Naming a Data Module and Its Unit File

From RAD Studio
Jump to: navigation, search

Go Up to Creating and Editing Standard Data Modules

The title bar of a data module displays the module's name. The default name for a data module is "DataModuleN" where N is a number representing the lowest unused unit number in a project. For example, if you start a new project, and add a module to it before doing any other application building, the name of the module defaults to "DataModule2." The corresponding unit file for DataModule2 defaults to "Unit2."

You should rename your data modules and their corresponding unit files at design time to make them more descriptive. You should especially rename data modules you add to the Object Repository to avoid name conflicts with other data modules in the Repository or in applications that use your modules.

To rename a data module

  1. Select the module in the Form Designer.
  2. Edit the Name property for the module in the Object Inspector.

The new name for the module appears in the title bar when the Name property in the Object Inspector no longer has focus.

Changing the name of a data module at design time changes its variable name in the interface section of code. It also changes any use of the type name in procedure declarations. You must manually change any references to the data module in code you write.

To rename a unit file for a data module, select the unit file.

See Also