g4fRs‖Type Statement

Contents
NFLrZ‖

# 9LuBk‖Type Statement

TYvyD‖Define non-UNO data structures.

hGDzF‖A Type structure is an ordered collection of data fields, that can be manipulated as a single item.

### FVEx2‖Syntax:

WfsVY‖

             Type struct_name
                 DataField1 As TypeName1
                 DataField2 As TypeName2
                 (...)
             End Type ' struct_name

##### 48EEb‖array fragment

YD32W‖

          ( [[start To] end], .. )

##### zrpkq‖Parameters

dUCSu‖start: Lower bound of a dimension.

yeb4H‖end: Upper bound of a dimension.

wyE23‖Multiple dimensions for an array are denoted using comma (,) sign.

##### E9UTU‖typename fragment

AqfYj‖

          {Boolean|Byte|Currency|Date|Double|Integer|Long|Object|Single|String|Variant}

edCVA‖Extended types such as Type statement structures, UNO objects or ClassModule objects are valid typenames.

##### BSD4e‖char fragment

JFwPg‖

          { % | & | ! | # | $ | @ }

TTALN‖A Type structure scope is that of the module it belongs to.

### EFSA4‖Example:

             Type Customer
                 Name1 As String
                 City As String
             End Type ' Customer structure
             Sub setCustomer
                 Dim oCustomer as New Customer
                 oCustomer.Name1 = "The Document Foundation"
                 oCustomer.City = "Berlin"
             End Sub

TtH8F‖Enumerations can be created using Type statement definitions. Calling Python Scripts from Basic illustrates that mechanism.

Related Topics

Option ClassModule Statement

iSJAV‖CreateObject function

Please support us!