Results 1 to 4 of 4

Thread: Class .. non class

  1. #1
    Join Date
    Feb 2004
    Location
    Oud Gastel, The Netherlands
    Posts
    357

    Class .. non class

    What exactly is the difference between a class module and a normal module ?? :?: :?: :arrow:

    And when should i use option explicit ?? :evil: :?:

  2. #2
    Join Date
    Mar 2004
    Location
    Brisbane, Australia
    Posts
    856
    8) YosSa...I'll get back to you on this one....I'll send you a PM aswell

  3. #3
    Join Date
    Feb 2004
    Location
    Oud Gastel, The Netherlands
    Posts
    357

    Yo yo

    would be great :lol:

    Dont keep me waiting to long ... getting old here :!: :mrgreen:

  4. #4
    Join Date
    Mar 2004
    Location
    Brisbane, Australia
    Posts
    856
    I found this on the net which give a pretty good expalnation of the two.
    Hope it helps.

    standard module
    - A dumping ground for public variables, public enumerations, public types, and public subs/functions
    - Code placed here that's not typed as PRIVATE can be accessed from anywhere in your project
    - Standard modules do NOT need to be initialized... simply call the functions it contains directly

    class module
    - These are objects that have to be initialized ( i.e. Set MyVariable = New MyClass )
    - These objects have to be cleaned up or terminated once they are no longer needed ( i.e. Set MyVariable = Nothing )
    - Class modules automatically call a privately declared sub called "Class_Initialize" (no parameters) whenever they are SET. This allows you to initialize any variables or information related to your class.
    - Class modules automatically call a privately declared sub called "Class_Terminate" (no parameters) whenever they are destroyed (set equal to NOTHING). This allows you to clean up any objects, variables, or information related to your class.
    - Class modules can be used to maintain "state" when it comes to information relating to your class. This means if you want to set the last accessed date of a property or sub... you can. You can maintain if the class is open, closed, pending, etc. and it remembers that (via Properties).
    - Class modules are usually used to encaposlate complex tasks and give you easy interfaces to them

Posting Permissions

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