Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
User Type vs Class - General question:
Are there any significant disadvantages to using a user defined type instead
of a class module? I know that Classes are more portable but seems that the two are interchangeable in many instances and it takes less code to use Type. So for one off solutions I tend to lean towards a user defined type and was just wondering if there was any big issue I was missing. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
User Type vs Class - General question:
I am with you on this one. Classes are great for events but otherwise not too
handy in Excel. The UDT is a great tool. It has much less overhead than a class. The only draw back is that a UDT can not have methods. -- HTH... Jim Thomlinson "Vacation's Over" wrote: Are there any significant disadvantages to using a user defined type instead of a class module? I know that Classes are more portable but seems that the two are interchangeable in many instances and it takes less code to use Type. So for one off solutions I tend to lean towards a user defined type and was just wondering if there was any big issue I was missing. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
User Type vs Class - General question:
Thanks Jim
With limited processing it's nice to limit processing. Now I don't need to think on that one anymore. "Jim Thomlinson" wrote: I am with you on this one. Classes are great for events but otherwise not too handy in Excel. The UDT is a great tool. It has much less overhead than a class. The only draw back is that a UDT can not have methods. -- HTH... Jim Thomlinson "Vacation's Over" wrote: Are there any significant disadvantages to using a user defined type instead of a class module? I know that Classes are more portable but seems that the two are interchangeable in many instances and it takes less code to use Type. So for one off solutions I tend to lean towards a user defined type and was just wondering if there was any big issue I was missing. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
User Type vs Class - General question:
If you look at what the machine is actually doing when it declares an
integer, or a double or a ... is it is reserving a memory space equivalent to an integer. When you retreive the value you just read that much memory. A UDT just defines the amount of memory required to hold all of the variables defined. That is why strings are so inefficient and why C does not have strings(null terminated array of charachters) . How much memory is required depends on the lenght of the string. Try to keep strings out our your UDT's if you have the need for speed as they will slow down the entire variable. If they do have strings in them pass them by ref and not by val which will improve the performance. By val has to make a copy of the variable. Based on the level of your coding that I have seen I figure that you probably know all of this but on the off chance... -- HTH... Jim Thomlinson "Vacation's Over" wrote: Thanks Jim With limited processing it's nice to limit processing. Now I don't need to think on that one anymore. "Jim Thomlinson" wrote: I am with you on this one. Classes are great for events but otherwise not too handy in Excel. The UDT is a great tool. It has much less overhead than a class. The only draw back is that a UDT can not have methods. -- HTH... Jim Thomlinson "Vacation's Over" wrote: Are there any significant disadvantages to using a user defined type instead of a class module? I know that Classes are more portable but seems that the two are interchangeable in many instances and it takes less code to use Type. So for one off solutions I tend to lean towards a user defined type and was just wondering if there was any big issue I was missing. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
User Type vs Class - General question:
OK, so I thought I was trying to be funny with the "With limited processing
it's nice to limit processing." line refering to my figuring out what I didn't need to think about. Thanks I'll remember to fully qualify my humor in the futu) "Jim Thomlinson" wrote: If you look at what the machine is actually doing when it declares an integer, or a double or a ... is it is reserving a memory space equivalent to an integer. When you retreive the value you just read that much memory. A UDT just defines the amount of memory required to hold all of the variables defined. That is why strings are so inefficient and why C does not have strings(null terminated array of charachters) . How much memory is required depends on the lenght of the string. Try to keep strings out our your UDT's if you have the need for speed as they will slow down the entire variable. If they do have strings in them pass them by ref and not by val which will improve the performance. By val has to make a copy of the variable. Based on the level of your coding that I have seen I figure that you probably know all of this but on the off chance... -- HTH... Jim Thomlinson "Vacation's Over" wrote: Thanks Jim With limited processing it's nice to limit processing. Now I don't need to think on that one anymore. "Jim Thomlinson" wrote: I am with you on this one. Classes are great for events but otherwise not too handy in Excel. The UDT is a great tool. It has much less overhead than a class. The only draw back is that a UDT can not have methods. -- HTH... Jim Thomlinson "Vacation's Over" wrote: Are there any significant disadvantages to using a user defined type instead of a class module? I know that Classes are more portable but seems that the two are interchangeable in many instances and it takes less code to use Type. So for one off solutions I tend to lean towards a user defined type and was just wondering if there was any big issue I was missing. |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
User Type vs Class - General question:
Don't feel bad.. It gave me the chance to use the phrase "Null terminated
array of charachters". It is a shame to take courses in C if you never get to say things like that. Now my day is complete... :-) -- HTH... Jim Thomlinson "Vacation's Over" wrote: OK, so I thought I was trying to be funny with the "With limited processing it's nice to limit processing." line refering to my figuring out what I didn't need to think about. Thanks I'll remember to fully qualify my humor in the futu) "Jim Thomlinson" wrote: If you look at what the machine is actually doing when it declares an integer, or a double or a ... is it is reserving a memory space equivalent to an integer. When you retreive the value you just read that much memory. A UDT just defines the amount of memory required to hold all of the variables defined. That is why strings are so inefficient and why C does not have strings(null terminated array of charachters) . How much memory is required depends on the lenght of the string. Try to keep strings out our your UDT's if you have the need for speed as they will slow down the entire variable. If they do have strings in them pass them by ref and not by val which will improve the performance. By val has to make a copy of the variable. Based on the level of your coding that I have seen I figure that you probably know all of this but on the off chance... -- HTH... Jim Thomlinson "Vacation's Over" wrote: Thanks Jim With limited processing it's nice to limit processing. Now I don't need to think on that one anymore. "Jim Thomlinson" wrote: I am with you on this one. Classes are great for events but otherwise not too handy in Excel. The UDT is a great tool. It has much less overhead than a class. The only draw back is that a UDT can not have methods. -- HTH... Jim Thomlinson "Vacation's Over" wrote: Are there any significant disadvantages to using a user defined type instead of a class module? I know that Classes are more portable but seems that the two are interchangeable in many instances and it takes less code to use Type. So for one off solutions I tend to lean towards a user defined type and was just wondering if there was any big issue I was missing. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
General multiple new user questions | New Users to Excel | |||
How can I expose the TextBox BeforeUpdate event to my user class? | Excel Discussion (Misc queries) | |||
Talking to a class or type between 2 sheets | Excel Programming | |||
Using Property Let with a Type as member of a Class | Excel Programming | |||
Can I create in VBA a class with instancing type different from 1 and 2? | Excel Programming |