I created a set of custom types in the Types module and want to use them in my library in other modules. How can i do this?
Public sets the type visibility in the library, if I understand correctly, but I cannot use them in other modules of my library.
I tried doing this in other modules:
Dim test = As new Types.Field
REM Or
Dim test = As new Field
but it causes an error
Module Test:
Option Explicit
Option Compatible
Public Enum FieldType
Text = "Text"
Numeric = "Numeric"
Date = "Date"
End Enum
REM declaration Field type
Public Type Conditional
Accept As String
Data As String
SkipEmptyCells As Boolean
Minimum As Integer
Maximum As Integer
ShowSelectedList As Boolean
SortItemsByAsc As Boolean
Elements As String
Formula As String
End Type
Public Type Help
Header As String
Tip As String
ShowOnSelectCell As Boolean
End Type
Public Type OnError
Hide As Boolean
Action As String
Header As String
Message As String
End Type
Public Type Validity
Conditional As Conditional
Help As Help
OnError As OnError
End Type
REM Metadata of Field
Public Type FieldMetadata
TechName As String
Validity As Validity
End Type
REM Advanced
Public Type Field
_Name As String
TechName As String
DefaultValue As Integer
Row As Integer
Column As String
Remark As String
Length As Integer
FieldType As FieldType
Metadata As FieldMetadata
End Type