The program structure in the Fore.NET language is organized using namespaces.
Each unit with program text consists of the following blocks (in the specified order):
Zero or more Imports directives.
Zero or more global attributes.
Zero or more declarations of namespaces and namespace members.
All blocks of all units, which an assembly consists of, are included into a common declaration space named global namespace.
The Imports directives facilitate the use of namespaces and types determined in other namespaces and affect the name resolution process during compilation.The Imports directive imports types contained in the specified namespace that enables the use of unqualified identifiers when referring to types. Import is executed only from the specified namespace without import of types from nested namespaces. If an imported namespace contains a member with the same name as a name declared within the current code or namespace body, the locally declared name has priority over the imported one.
A namespace declaration consists of the Namespace keyword, followed by a namespace name and body, ended with a sequence of End Namespace keywords.
A namespace can be declared at the level of a global namespace or within another namespace. In both cases the namespace name must be unique within the enclosing namespace. A namespace allows for declaring any types available in Fore.NET.
Namespaces have public access level and their declarations cannot contain access modifiers.
Optional Imports directives in a namespace body import names of other namespaces and types, allowing them to be referenced directly instead of through qualified identifiers.
Namespaces are extended if two namespace declarations with the same fully qualified names are added to the same declaration space.
Imports System;
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Ui;
[Assembly(AssemblyTitle("Test application"))]
[Assembly(AssemblyCompanyAttribute("Any Company"))]
[Assembly(AssemblyVersion("1.0.0.0"))]
Namespace UserApplication
Var
s: string;
i: integer;
Const
e = 0.0001;
//Declaration of types and type members
//organizing the code of the custom application
End Namespace;
See also: