Type Statement

  1. Type usertype elementname As typename

    1. [ elementname As typename]

      . . .

    End Type

Defines a user-defined data type containing one or more elements.

The Type statement has these parts:

Part

Description

Type

Marks the beginning of a user-defined type.

usertype

Name of a user-defined data type. It follows standard variable naming conventions.

elementname

Name of an element of the user-defined data type. It follows standard variable-naming conventions.

subscripts

Dimensions of an array element. You can declare multiple dimensions. (not currently implemented)

typename

One of these data types: Integer, Long, Single, Double, String (for variable-length strings), String * length (for fixed-length strings), Variant,  or another user-defined type. The argument typename can't be an object type. End Type Marks the end of a user-defined type.

Once you have declared a user-defined type using the Type statement, you can declare a variable of that type anywhere in your script. Use Dim or Static to declare a variable of a user-defined type. Line numbers and line labels aren't allowed in Type...End Type blocks.

User-defined types are often used with data records because data records frequently consist of a number of related elements of different data types. Arrays cannot be an element of a user defined type in Enable.

More:

Example - Type Statement