Try OpenEdge Now
skip to main content
GUI for .NET Programming
Accessing and Managing .NET Classes from ABL : Referencing and instantiating .NET classes : Using unqualified .NET type names
 

Using unqualified .NET type names

ABL provides the USING statement, which allows you to specify an ABL class or interface type by its unqualified type name, which is the class name or interface name, alone, specified without any defined package. This statement also allows you to specify unqualified .NET type names, which are .NET class or interface names specified without the defined namespace:

Syntax

USING type-spec[ FROM { ASSEMBLY | PROPATH }]
The type-spec represents one of the following:
*A single fully qualified ABL user-defined or .NET type name that you want to be able to specify in your code using its unqualified type name.
*An ABL package name (appended with .*), all of whose defined types you want to be able to specify in your code using their unqualified type names. Note that this cannot be a partial package name representing only the first few of several package components in the package name. The specified components must fully represent the package that contains the user-defined types that you want to reference with unqualified names.
*A .NET namespace (appended with .*), all of whose defined types you want to be able to specify in your code using their unqualified type names. Note that, similar to ABL package names, you must specify a complete namespace that contains the object types whose unqualified names you want to reference. You cannot reference type names using nested namespaces within a given namespace as supported for CLS-compliant languages.
The type-spec can also represent a fully qualified .NET generic type or generic type namespace. Also you can use a namespace or fully qualified type name in one USING statement to resolve an unqualified type name specified for a type parameter of the generic type in a subsequent USING statement or other ABL statement.
The FROM option tells ABL where to search for the types that you reference according to this statement. If you specify ASSEMBLY, ABL treats type-spec as a .NET type or namespace reference, and searches for a given unqualified type name only in the available assemblies (see Identifying .NET assemblies to ABL). If you specify PROPATH, ABL treats type-spec as an ABL user-defined type or package reference, and searches for a given unqualified type name using only the specified package on PROPATH.
If you do not specify the FROM option in the USING statement, ABL resolves unqualified type names by combining them with the type-spec in the following search order until it finds a match with:
1. A built-in ABL class or interface type
2. An ABL user-defined type
3. A .NET type
For more information and examples of USING statements for qualifying .NET types, see the USING statement reference entry in OpenEdge Development: ABL Reference.