Type-name syntax

Specifies the name of an ABL or .NET data type that you can specify as a single instance or as an array of such instances. Thus, an ABL data type can be a built-in primitive type or an array of such primitive types, or it can be a class-based built-in or user-defined object type (such as a class, enumeration, or interface type) or an ABL array of such object types. A .NET data type can only be a class-based object type (such as a class, structure, enumeration, or interface) or an ABL array of such object types. The EXTENT option, used to define an array of types, is thus counted as part of the array type name.

Syntax

{ primitive-type-name | object-type-name } [ EXTENT [ constant ] ]
primitive-type-name

An unquoted string that specifies the name of a built-in ABL primitive type. For information on the supported primitive types and their names, see the Data types reference entry.

object-type-name

Specifies an ABL or .NET object type using the following syntax:

[ " ] ABL-object-type [ " ] |
[ " ] dotNET-object-type [ " ]
[ " ] ABL-object-type [ " ]
An ABL object type, where ABL-object-type consists of text elements with the following syntax:
[  package-name . ] class-interface-or-enum-name
package-name
A period-separated list of text components that, along with class-interface-or-enum-name, uniquely identify an ABL class, interface, or enum. These text components specify a package that is based on a valid directory pathname, relative to PROPATH, which identifies the location of the file that defines the class, interface, or enum. Thus, each text component of package-name maps to a directory level in the path, and each slash separator in the path corresponds to a period separating two components.

If specified, the relative path of the class definition file represented by package-name must remain constant between compile time and run time. If the class definition file resides directly on PROPATH, the class or interface is not defined in a package and therefore has no package-name in its type name.

With the presence of an appropriate USING statement you can also specify an ABL object type that is defined in a package using the class-interface-or-enum-name without its qualifying package-name. For more information, see the notes for this reference entry.

class-interface-or-enum-name

The name of an ABL class, interface, or enumeration. This name must match the name of a class definition file (excluding the .cls or .r extension) located in the relative path represented by package-name, if specified. The name must begin with an alphabetic character and it cannot contain a period or a space.

If the ABL-object-type has a package-name that contains embedded spaces, you must enclose the entire ABL-object-type in quotes ("). Otherwise, quotes are optional.

Note: Do not place a class definition file in a directory whose name contains a period (.) character; ABL interprets the component after the period as another directory level and will therefore not find the referenced class definition file.
[ " ] dotNET-object-type [ " ]
A .NET object type, where dotNET-object-type consists of text elements with the following syntax:
[ namespace . ] dotNET-object-name  [ + inner-name ]
namespace

A period-separated list of text components that, along with dotNET-object-name, uniquely identify a .NET type. The components of namespace are defined according to .NET requirements. ABL does not support access to .NET types defined in the default namespace. In other words, you cannot access a .NET type that does not have a namespace defined for it.

However, with the presence of an appropriate USING statement, you can also specify a .NET object type using the dotNET-object-name without its qualifying namespace. For more information, see the notes for this reference entry.

dotNET-object-name
The name of a .NET class (including a structure or enumeration), delegate, interface, or other object type referenced within the .NET namespace specified by namespace.
inner-name
The name of a .NET nested (inner) type defined within the .NET type definition specified by namespace.dotNET-object-name. Thus, inner-name can represent the name of an:
  • Inner class defined by the specified .NET class

  • Inner enumeration defined by the specified .NET class

  • Inner interface defined by the specified .NET interface

    Caution:
    .NET languages normally separate the name of an inner type from the defining type name using a period (.). You must replace this period with a plus sign (+) to reference the inner type name in ABL.

    If the name part of the dotNET-object-type contains any embedded spaces, square brackets ([]), or angle brackets (<>) you must enclose the entire dotNET-object-type in quotes ("). Otherwise, quotes are optional.

For more information on defining object types in ABL, see the CLASS statement or the INTERFACE statement reference entry, depending on the type of class-based object.

EXTENT [ constant ]

EXTENT indicates that it is an array of the specified type and constant is an integer value that specifies the number of elements in the array. Without constant, the array is an indeterminate array type.

For more information on defining ABL data elements with primitive or object types, see the DEFINE PARAMETER statement, the DEFINE PROPERTY statement, the DEFINE TEMP-TABLE statement, the DEFINE VARIABLE statement, the DEFINE WORK-TABLE statement, or the Parameter definition syntax reference entry.

Example

If your PROPATH is "C:/myfiles", and your class definition file name is "C:/myfiles/acme/myObjs/CustObjs.cls", then ABL requires package-name to be "acme.myObjs." and class-or-interface-name to be "CustObjs".

The .NET Button class is in the System.Windows.Forms namespace. Therefore, you reference its qualified (complete) type name like this:

System.Windows.Forms.Button

The .NET ControlCollection class is an inner class of System.Windows.Forms.Control. Therefore, you reference its qualified type name like this:

System.Windows.Forms.Control+ControlCollection

The following code fragment defines object references to the .NET type, System.Drawing.Point, and to a one-dimensional .NET array of System.Drawing.Point elements:

DEFINE VARIABLE rPoint      AS CLASS System.Drawing.Point NO-UNDO.
DEFINE VARIABLE rPointArray AS CLASS "System.Drawing.Point[]" NO-UNDO.

Notes

See also

Class-based data member access, Class-based method call, Class-based property access, CLASS statement, Data types, DEFINE VARIABLE statement, ENUM statement, INTERFACE statement, NEW function (classes), USING statement