Results 1 to 4 of 4

Thread: Difference btw Modules and Forms

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2000
    Location
    Singapore
    Posts
    98
    Hi guys,
    I read quite a few threads here and i don quite understand the relationship btw Modules and forms and how it affect the declaration of a function.


    Can somebody explain to me how it works?

  2. #2
    Hyperactive Member theman32x's Avatar
    Join Date
    May 2000
    Location
    New Jersey, USA
    Posts
    305

    well

    i'm not an expert but i think the difference is that when you write a function in a form it is limited to that form and project that you are making

    if you use a module than you can add it to any project and access the code to it ... therefore you aren't limited ???

  3. #3
    Member
    Join Date
    Oct 2000
    Posts
    47

    Cool module=global declarations areab

    the idea of a module is to be accessible to all forms...
    in a normal form the double-clicking on a button will create:

    Private sub command1_click()

    end sub

    notice the word..."private"...that mean that this specific sub\function is accessible only through this specific form

    if you change the "private" to "public" then this sub\function will be accessible through all forms or modules


    about modules :

    a module will usually contain function called "Public"...
    that's because the module is kinda global function library..

    though...you can rename functions in a module as "Private" if you are intending to use it only in that specific module (could be in order to help other function in that module

    DealMan

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221

    Thumbs up

    Forms can contain controls, and recieve events during to window messages sent to the window that is the form. Modules don't need to be accessed by their name. That's the most important differences.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

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