Example:

  1. ' This sample shows some of the features of user defined types

     

    Type type1

    1. a As Integer

      d As Double

      s As String

    End Type

     

    Type type2

    1. a As String

      o As type1

    End Type

     

    Type type3

    1. b As Integer

      c As type2

    End Type

     

    Dim type2a As type2

    Dim type2b As type2

    Dim type1a As type1

    Dim type3a as type3

     

    Sub Form_Click ()

    1. a = 5

      type1a.a = 7472

      type1a.d = 23.1415

      type1a.s = "YES"

      type2a.a = "43 - forty three"

      type2a.o.s = "Yaba Daba Doo"

      type3a.c.o.s = "COS"

      type2b.a = "943 - nine hundred and forty three"

      type2b.o.s = "Yogi"

      MsgBox type1a.a

      MsgBox type1a.d

      MsgBox type1a.s

      MsgBox type2a.a

      MsgBox type2a.o.s

      MsgBox type2b.a

      MsgBox type2b.o.s

      MsgBox type3a.c.o.s

      MsgBox a

    End Sub