USING statement

Allows you to reference a single specified ABL or .NET object type, or reference all the types in an ABL package or .NET namespace, using their unqualified type names.

Syntax

USING
  { object-type-name | { package-name | namespace } .* }
  [ FROM { ASSEMBLY | PROPATH } ]
object-type-name

Specifies the qualified type name of a single ABL class or interface, or of a single .NET class, structure, interface, or enumeration. This type name must be the fully qualified type name (including the package or namespace) of an ABL or .NET class or interface type (as described in the Type-name syntax reference entry).

Use this option to identify a single ABL class or interface defined in a package, or a single .NET class, structure, interface, or enumeration defined in a namespace, that you want to reference by its unqualified type name.

The value of object-type-name is restricted to alphanumeric characters plus the symbols #, $, %, and _.

{ package-name | namespace } .*

Specifies an ABL package-name that includes ABL classes or interfaces that you want to reference, or a .NET namespace that includes .NET classes (including structures and enumerations) or interfaces that you want to reference, where an unqualified class, interface, structure, or enumeration name can replace '*' to form a valid fully qualified type name.

Use this option to identify all the ABL classes or interfaces defined in a package, or all the .NET classes, structures, interfaces, or enumerations defined in a namespace, for reference by their unqualified type names.

This expression is restricted to alphanumeric characters plus the symbols #, $, %, and _.

[ FROM { ASSEMBLY | PROPATH } ]

Optionally identifies where to locate a given type definition whose type is being referenced using this statement. This identification permits the ABL compiler to focus its search for the type definition depending on whether the USING statement specifies an ABL package-based type or a .NET namespace-based type. When you specify the FROM ASSEMBLY option, ABL assumes that the type is a .NET type and uses the list of .NET assemblies defined in the assembly identification file to search for the type definition. When you specify the FROM PROPATH option, ABL assumes that the type is an ABL type and uses PROPATH to search for the type definition. If you do not specify a FROM option, the search for a type definition first uses PROPATH, then uses the specified list of .NET assemblies. In most cases, the use of an appropriate FROM option improves compile-time performance.

Example

You can use either one of the following code fragments to reference the class Acme.BusObjs.Customer using its unqualified or fully qualified class name:

USING Acme.BusObjs.*. 

DEFINE VARIABLE CustObj  AS CLASS Customer.
DEFINE VARIABLE CustObj2 AS CLASS Acme.BusObjs.Customer.
USING Acme.BusObjs.Customer. 

DEFINE VARIABLE CustObj  AS CLASS Customer.
DEFINE VARIABLE CustObj2 AS CLASS Acme.BusObjs.Customer.

The ControlCollection class is an inner class of the .NET class System.Windows.Forms.Control. Therefore, you can reference these class types by their unqualified type names like this:

USING System.Windows.Forms.* FROM ASSEMBLY.

DEFINE VARIABLE rControl    AS CLASS Control.
DEFINE VARIABLE rCollection AS CLASS Control+ControlCollection.

Notes

See also

CLASS statement, INTERFACE statement, Type-name syntax