Q: What is the modules

hi,

i'm new and i want to know what is hte differece between classes and modules , and when to use modules,

thx




Answer this question

Q: What is the modules

  • Kiran05

    hi,

    Thx guys for answering me, actualy i know visual basic through my previous experiance with Asp 0.3 b4 asp.net appears, i don't know that much about classes or those thing i'm still learning it. but to be more specific here its what i'm asking about.

    actualy i'm working in my first program but it turned to be a jungle of code lines, even it became very hard to find things , every thing in my class depend on the same datasource that i keep editing all the time by that program, so can i call particular subrotine from my module as just block of code without passing my datasource to this module, just to reduce the number of code lines in my form class.

    to be much more specific if you saw absolute beginners vedio he added lots of helper methods can i shift those helper methods to a module or not

    i know if made other class i can't call it without passing the datasource because classes are much independent

    is this the use of modules

    thx



  • Matt17

    Hi shak,

    The purpose of a module is to contain subroutines or Functions and to declare Variables or Arrays with the Public Command.  Modules have no visible properties and have no events because they have no controls.  Subs within the module are made available to your entire program (global) as opposed to local to a partuclar form or even more local to a particular procedure.

    The 'Visual Baic 2005 Express Edition for Dummies by Richard Mansfield is a great book for beginners.  It had most of the stuff I needed in there to write my first program (post you helped me with - Database Stuff). You just have to learn to ignore Mansfields many cheap shots at Microsoft within his text.

    Matt


  • jony

     shakalama wrote:

    hi,

    Thx guys for answering me, actualy i know visual basic through my previous experiance with Asp 0.3 b4 asp.net appears, i don't know that much about classes or those thing i'm still learning it. but to be more specific here its what i'm asking about.

    actualy i'm working in my first program but it turned to be a jungle of code lines, even it became very hard to find things , every thing in my class depend on the same datasource that i keep editing all the time by that program, so can i call particular subrotine from my module as just block of code without passing my datasource to this module, just to reduce the number of code lines in my form class.

    to be much more specific if you saw absolute beginners vedio he added lots of helper methods can i shift those helper methods to a module or not

    i know if made other class i can't call it without passing the datasource because classes are much independent

    is this the use of modules

    thx

    You are Writing Procedural Code(Spaghetti) in an OOP Environment......... From MS-Help "A Class statement defines a new data type. A class is a fundamental building block of object-oriented programming (OOP)."

    The Short Answer is You need to Write your Own Classes...... Write Many Small Clean Classes that Solve Your Particular Big Spaghetti Problem....... Many Small Clean Classes Dotted together To Solve Your Big Spaghetti Problem...... This is the Essence of OOP..... The Framework is a GodZillion Elegant Classes......

    Check Form1.Designer.vb..... It is a Class with Many Calls to the Framework.......

    Also Books are a Bonus but You can Survive With MS-Help..... It is Excellent......

     


  • bencoffin

     

    Modules are not instantiatable - classes are. I can have as many instantiations of a class as I want. Modules have only one.



  • Murre

    hi, foxmcf

    thx for your careing my friend, i hope if i can find that book i'm an egyptian we are not english speakers so its hard to find those books and if you find it , it will be very expencive anyway it sounds a good book i'll try to find it God Willing



  • technicalganesh

    You wanna know the difference between module's an class module's

  • Q: What is the modules