Type Definition
Syntax
[ | Private
| Public ] _
Type name
elem
[([dimension[, ...]])] As [New] type
[...]
End Type
Group Declaration
Description Define a new user type. Each elem defines an element of the type for storing data. As [New] type defines the type of data that can be stored. A user defined type variable has a value for each elem. Use .elem to access individual element values.
Access If no access is specified then Public is assumed.
Example
'#Language
"WWB-COM"
Type Employee
FirstName As
String
LastName As
String
Title As String
Salary As Double
End Type
SubMain
Dim e As Employee
e.FirstName = "John"
e.LastName =
"Doe"
e.Title = "President"
e.Salary
= 100000
Debug.Print e.FirstName
'"John"
Debug.Print e.LastName
'"Doe"
Debug.Print
e.Title '"President"
Debug.Print e.Salary ' 100000
EndSub