A namespace search example

The following example project and unit files use the namespace clause to establish a namespace search list:

// Project file declarations... program MyCompany.Programs.MyProgram;

namespaces MyCompany.Libs.UIWidgets, MyCompany.Libs.Network;

// Unit source file declaration... unit MyCompany.Programs.Units.MyUnit1;

Given this program example, the compiler would search namespaces in the following order:

  1. MyCompany.Programs.Units
  2. MyCompany.Programs
  3. MyCompany.Libs.Network
  4. MyCompany.Libs.UIWidgets
  5. Namespaces specified by compiler options.

Note that if the current unit is generic (i.e. it does not have an explicit namespace declaration in its unit statement), then resolution begins with the project default namespace.

Project Management Made Easy

Project Management Made Easy

What you need to know about… Project Management Made Easy! Project management consists of more than just a large building project and can encompass small projects as well. No matter what the size of your project, you need to have some sort of project management. How you manage your project has everything to do with its outcome.

Get My Free Ebook

Post a comment