| **Navigation:**  [[clarion.htm|Clarion.Net (Clarion#)]] > [[clarion net language reference.htm|Clarion# Language Extensions]] > Compiler Directives >====== NAMESPACE (declare a scope) ====== | [[ref parameter passed by reference .htm|{{btn_prev_n.gif|Previous page}}]][[clarion net language reference.htm|{{btn_home_n.gif|Return to chapter overview}}]][[using reference a namespace .htm|{{btn_next_n.gif|Next page}}]] | | || {{newcnet.jpg|NewCNet.jpg}} **NAMESPACE ****//identifier//**** [,GLOBALCLASS (****//name//****)]** {{blk2blue.jpg|blk2blue.jpg}} | **NAMESPACE** | declare a program element's scope | | //identifier// | A string that identifies the NAMESPACE. Quotes around the string name are not required. Parenthesis are optional. | | **GLOBALCLASS** | Set explicit name of global class | | //name// | A string constant that identifies the name of the global class. | The **NAMESPACE** compiler directive is used to declare a scope within the .NET framework. This scope lets you organize code and gives you a way to create globally-unique types. Namespaces are used both as an "internal" organization system for a program, and as an "external" organization system ' a way of presenting program elements that are exposed to other programs. {{notebox.jpg|NoteBox.jpg}} You cannot name an object (FILEs, CLASSes, QUEUEs, GROUPs, data types, etc.) that uses the same name as the containing //identifier//. The compiler will post a CLA0185 error (Identifier is already defined). **NAMESPACE** can be placed only in the global data section after the PROGRAM statement in the program source files, or in the local static data section after a MEMBER statement in the member source files. You can use namespace directive in included files (see INCLUDE directive). In this case the directive must be first statement in the included file. If a MEMBER module doesn't contain a **NAMESPACE** directive, then the PROGRAM module's namespace is used for the MEMBER module. All global declarations of a namespace are translated as members of special global class. By default the //name// of the global class is //Global//<;name of source file>. You can set the name of global class explicitly with GLOBALCLASS attribute. The use of GLOBALCLASS is optional, and is seldom used or required. **Example:** PROGRAM NAMESPACE(Threads),GLOBALCLASS('Gthread') USING(System) USING(System.Drawing) USING(System.Windows.Forms) **See Also:** [[using reference a namespace .htm|USING (reference a namespace)]]