Naming unit and project source code files

 

As you open new units in a project, the product gives them default names: UNIT1.pas UNIT2.pas, UNIT3.pas, and so on. You can change a unit's default name to a meaningful (and unique) name when you save the project.

To name a unit file:

1.         Select the unit file.

2.         Edit the Name property for the unit in the Object Inspector.

The product also supplies a default name for the project file (project1.dpr) which you can rename when you save the project.

All unit and project file names must be legal Object Pascal identifiers. When the compiler looks for a unit or project file, it first searches for a file with the full name of the unit or project identifier. If it does not find that file, it then searches for a version of the identifier name, truncated to eight characters. This is for backward compatibility and for compatibility with file servers that store only short file names. You should not manually truncate your file names.