Click to See Complete Forum and Search --> : modular programming


PanasonicSubz
December 19th, 1999, 11:42 AM
whats a module for? some people have told me that it repeats stuff and some weird stuff. i just want a simple basic way for me to no what a module is. i no that it is a .bas file and i no if you want to call a sub you just type call whatever(). thanks

PanasonicSubz

Ruth Glushkin
December 20th, 1999, 01:57 AM
First of all, you just have to understand that every variable and function has its own range of validity.
I mean, that if you, for example, in Private Sub Form1_Load write Dim MyVar1 As Integer, this variable
exist only during execution of this subroutine, so other functions and subroutines don't understand and
don't recognize this variable. The same thing is with the functions and subroutines, so if you'll try to use the above mentioned Form1_Load in Form2, it will not work. There is a good way to use variables,
functions, etc., in other places. You just declare them as Public. It is a common way to put all the public
declarations in Module. You don't must do it, it just a common way, like you can give your variable any
name, but if you want that somebody else understand your program, you add to this name first letter,
which shows the type of this variable, for example, Dim iCount As Integer. So if you want to look on
all of your Public variables, user-defined types, functions, subroutines, API functions, etc., you'll find them in one place, in Module. Again, you can put them where you want, nobody will press on you to do it, it is like a good habbit, accepted by most programmers.

AndyK
December 20th, 1999, 06:09 PM
How many times do we have to tell you go read some VB books....it'll be better for you and for us if you would read at least one book.

Chris Eastwood
December 21st, 1999, 03:10 AM
LOL!

But that would involve *reading* and then he'd actually have to do some *coding* - plus the fact that this post has been answered correctly about 3 times so far (check the posting history)


Chris Eastwood

CodeGuru - the website for developers
http://codeguru.developer.com/vb

AndyK
December 21st, 1999, 11:30 AM
LOL!
The point is that he never reads any books and he never uses VB help....but plus to all this he can't even read replys to his own postings!!!!
You know I'll be cracking up if he'll decide to set his "program" as a commercial product!!!
So called "programmer"....

vbfingers
December 25th, 1999, 08:50 PM
From one past programmer,

In other words, You will not have to 're-invent' the same wheel over, and over again. You only need to invent the wheel(source code/software) only ONCE. Now hit the book.