|
-
Nov 1st, 2000, 07:06 PM
#1
Thread Starter
Lively Member
I have a type:
Public Type autoPivotCreationType
clicks As Integer ' Integer variable stores clicks.
campaignName As String ' String variable stores campaign name.
jobName As String ' String variable stores job name.
strategyName As String ' String variable stores strategy name.
dateTime As String ' Date variable stores the date of a transaction.
isEmpty As Boolean
End Type
I want this to be dynamic where I can add subcategories within the type. For Example:
Public Type autoPivotCreationType
isEmpty As Boolean 'isEmpty being a constant paramater within this type
End Type
and then I can add other subtypes later... or somehow create the dynamic subs when creating a variable of autoPivotCreationType.
Like:
Dim arrayForTopTen(10) As autoPivotCreationType
and being able to somehow set stuff like:
arrayForTopTen(1).test = ""
arrayForTopTen(1).someOtherNewField = ""
Ok... hope this makes some sort of sense. Thanx in advance for teh help.
-cLocKwOrk
-
Nov 1st, 2000, 07:44 PM
#2
Lively Member
Don't think that dynamically defining/assigning Type is possible, but why not use nested UDT.
For example
Type typeEmployee
FirstName as string
LastName as string
end type
Dim Employee as typeEmployee
Type typeDepartment
DepartmentName as string
ThisEmploy as typeEmployee
end type
Dim Department as typeDepartment
Department.DepartmentName = "Sales"
Department.ThisEmploy.FirstName = "Fred"
Department.ThisEmploy.LastName = "Jones"
You can declare new structures, based on existing structs. The Employee Struct becomes a subset of the Department Struct.
Hope this is of some assistance
Adrian
-
Nov 1st, 2000, 07:47 PM
#3
Thread Starter
Lively Member
That's funny... while I was waiting for a reply, I decided to try it out that way just in case the dynamic way wasn't possible.
Thanks for the help. =)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|