+ Reply to Thread
Results 1 to 6 of 6

User Type vs Class - General question:

  1. #1
    Vacation's Over
    Guest

    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. #2
    Jim Thomlinson
    Guest

    RE: 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. #3
    Vacation's Over
    Guest

    RE: 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. #4
    Jim Thomlinson
    Guest

    RE: 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. #5
    Vacation's Over
    Guest

    RE: 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 future

    "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. #6
    Jim Thomlinson
    Guest

    RE: 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 future
    >
    > "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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1