Object Variable Declaration

You can declare an object variable the same as other data types. But there are also special statements available if necessary.

Declaration syntaxes

Dim statement

Dim variable_name As object_class

New statement (one-line)

This construct is shorter to write than Dim.

[ New ] object_class variable_name

New statement (block)

This construct is available if the last argument passed to a class is an array.

[ New ] object_class variable_name
Begin
    expression_list
End object_class

Object statement

This construct is available to make a singleton object. That is where a type is permitted to have only one instance variable.

Object variable_name
    object_members
End [ Object ]

See also