Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 279
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 279
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 279
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
General multiple new user questions slindsey New Users to Excel 1 February 15th 07 11:09 AM
How can I expose the TextBox BeforeUpdate event to my user class? bereid Excel Discussion (Misc queries) 0 November 30th 05 05:00 PM
Talking to a class or type between 2 sheets Torben Laursen Excel Programming 1 September 16th 04 12:30 PM
Using Property Let with a Type as member of a Class Ken Dahlberg Excel Programming 5 December 21st 03 05:57 AM
Can I create in VBA a class with instancing type different from 1 and 2? Dmitry V. Petkun Excel Programming 2 November 4th 03 05:31 PM


All times are GMT +1. The time now is 10:44 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"