Type Statement

Defina estructuras de datos no UNO.

Una estructura Type es una colección ordenada de campos de datos que puede manipularse como un único elemento.

Sintaxis:

Diagrama de la instrucción Type

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

array fragment

( [[start To] end], .. )
Parámetros

start: Lower bound of a dimension.

end: Upper bound of a dimension.

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

typename fragment

primitive data types fragment

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

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


char fragment

type declaration characters

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

El alcance de una estructura Type corresponde a aquél del módulo al que pertenece.


Ejemplo:

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
tip

Es posible crear enumeraciones a través de definiciones de instrucción Type. La página Llamar secuencias de órdenes en Python desde Basic ilustra el mecanismo.


¡Necesitamos su ayuda!