Results 1 to 2 of 2

Thread: When should I use Functions within a structure?

  1. #1

    Thread Starter
    Frenzied Member <ABX's Avatar
    Join Date
    Jul 2002
    Location
    Canada eh...
    Posts
    1,622

    When should I use Functions within a structure?

    Lets say Im writing a class that does some information parsing and has many Properties. Now some of these properties could be divided into groups

    eg:

    my class describes some version info about the data that is coming in

    eg. Major Version, Minor Version, Revision, Build Number

    should I do somthing like this

    VB Code:
    1. Class MyTestClass
    2.  
    3. Public structure sVersion
    4.    Dim sMajor as Short
    5.    Dim sMinor as Short
    6.    Dim sRevsion as Short
    7.    Dim sBuild as Short
    8.  
    9. Functon Parse(strData as String)
    10. 'sets values about based on strData
    11. End Function
    12. End Structure
    13.  
    14. End Class
    Tips:
    • Google is your friend! Search before posting!
    • Name your thread appropriately... "I Need Help" doesn't cut it!
    • Always post your code!!!! We can't read your mind!!! (well, at least most of us!)
    • Allways Include the Name and Line of the Exception (if one is occuring!)
    • If it is relevant state the version of Visual Studio/.Net Framwork you are using (2002/2003/2005)


    If you think I was helpful, rate my post
    IRC Contact: Rizon/xous ChakraNET/xous Freenode/xous

  2. #2
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    If it's only a function and you'll have a LOT of structs its okay, otherwise just stick out with classes
    \m/\m/

Posting Permissions

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



Click Here to Expand Forum to Full Width