Search:

Type: Posts; User: tonyd5

Search: Search took 0.03 seconds.

  1. Re: Should I use a Class or a Structure, (Matrix Tool)

    It'll work for the first 2 examples. Every item in the array calls 'Clone' again... its recursive.
    Every member in a object calls Clone again... keeps going and going until it gets to the valuetype.
  2. Re: Should I use a Class or a Structure, (Matrix Tool)

    Wrapper Class..



    ' Matrix wrapper Class, uses MatrixStruct
    ' has methods and properties that allow matrix to be easily edited and viewed by user
    Public Class MatrixObject

    Private...
  3. Re: Should I use a Class or a Structure, (Matrix Tool)

    Could not fit everything in 1 post....

    Code for Structure & Class



    Imports System.Numerics


    Imports System.Runtime.InteropServices
  4. Re: Should I use a Class or a Structure, (Matrix Tool)

    Your suspiscions are correct, The Structure was NOT the cause of the major performance gain... The changing the Structure to a Class was only few % points slower...



    What was change:

    In the...
  5. Re: Should I use a Class or a Structure, (Matrix Tool)

    ... I have made a universial clone function for anything. makes deep sea copys of all members(any type including objects) and can handle arrays of arrays of arrays....

    Its monster, very slow. I...
  6. Re: Should I use a Class or a Structure, (Matrix Tool)

    Yep, figured that out. Had to make copy methods... annoying.
    I made structures with arrays members in another program I'm working on; Did NOT have this problem, arrays members were copied just...
  7. Re: Should I use a Class or a Structure, (Matrix Tool)

    Initial results indicate the Structure w/methods wrapped in a Class is many many times faster.
    I need to verify this with more testing. I'll post the code and performance time when finished.
  8. Re: Should I use a Class or a Structure, (Matrix Tool)

    working on it...
  9. Re: Should I use a Class or a Structure, (Matrix Tool)

    Ok,
    What if the Structure w/ methods is private within a wrapper Class... So that it is controlled and never unnecessarily copied.

    Is that any different then just using a Class?

    All the...
  10. Should I use a Class or a Structure, (Matrix Tool)

    I made a Class for matrix operations, [MatrixObject]. I am mainly concerned with the inverse; I need to calculate many large matrix inverse's for this application.( size:~[R100xC100])

    Right now...
  11. Re: Saving/Loading UDT(s) as text file, 32b and 64b system

    I'll see if the UDTs are different lengths with LenB tomorrow. Should give some insight.

    Doesn't have to be text based. Maybe if I save it as a binary file it will resolve it. The text formatting...
  12. Re: Saving/Loading UDT(s) as text file, 32b and 64b system

    I made sure the UDTs only include:

    Strings
    Integers
    Longs
    Doubles
    Bytes


    Maybe on the 64b computer its saving integers as 32b and not 16b.
  13. Re: Saving/Loading UDT(s) as text file, 32b and 64b system

    I didn't put the code to keep things straight forwarded... I believe the problem is with Put & Get functions differing on 32b & 64b systems.


    Excel VBA.
    No add-ins, no references.


    Computer1:
  14. Saving/Loading UDT(s) as text file, 32b and 64b system

    I am storing and recalling large UDT arrays as text files... Using the PUT & GET functions.

    The program using these text files to load previously parsed information.



    After moving the...
  15. Re: Passing UDT as variant, for saving/loading UDTs

    The serialization of UDTs is very power.

    Its basically a UDT --> Variant converter. Opens up a lot of options.
    I can add this feature to the existing solution I did without too much work.
    ...
  16. Re: Passing UDT as variant, for saving/loading UDTs

    I also looked into that briefly, that is very cool.

    The goal is for me or anyone to make Types like normal and be able to use a universal Save/Load function without doing anything extra what so...
  17. Re: Passing UDT as variant, for saving/loading UDTs

    I looked into that, CopyMemory, & Lset.
    I think I could not get it to work with UDT w/ dynamic arrays.

    And it would not solve the problem of passing/returning an arbitrary UDT to Save/Load...
  18. Re: Passing UDT as variant, for saving/loading UDTs

    Nvm, that is what I did... Just a more complete version...


    That is not what I did...

    I made these containers a Type and not a Class for a reason; I wanted them to behave like a value-type.
    I...
  19. Re: Class for saving/loading UDTs (User defined types)

    I got more universal Excel-VBA code.

    A Calendar tool, so you don't have to use Active-X
    A library of String tools.
  20. Class for saving/loading UDTs (User defined types)

    I made Class that has Save/Load functions for UDT arrays. And Get/Let Properties with the same name(s) as the user-type...
    I made it as copy/paste-able as possible, for adding/removing user-types to...
  21. Re: Passing UDT as variant, for saving/loading UDTs

    I got something. It was painful.
    I spent a while trying to figure out a work around. There is nothing.

    VB can't do reflections
    VB can't do overloads
    VB can't do GOTO labels outside of scope

    ...
  22. Re: Passing UDT as variant, for saving/loading UDTs

    Hang on, I think I know how.
  23. Passing UDT as variant, for saving/loading UDTs

    I have a program that reads/interprets user text; then uses the info to do other stuff.


    text (XL sheet) --> interpret routine --> UDT(s) (parameters(list) what the user text is saying)

    The...
Results 1 to 23 of 23



Click Here to Expand Forum to Full Width