|
-
Mar 17th, 2000, 07:39 AM
#3
Hyperactive Member
If you have only one form, it doesn't matter. When you write an application with more than one form, though, it becomes more efficient to put it in a module. Say, for example, you want to use a particular API in two different forms. Rather than define it twice as Private in both forms, simply putting it once as Public in the module saves lots of space in the end. Also, it is easier to manage all your code when you don't repeat it. If you have a group of code that you repeat over and over, make a sub in the module and call it whenever you need it from the form. Like if you want to do 1, 2, 3, a, b, and c in that order frequently throughout the program, put a sub in the module that says
Public Sub DOTHIS()
Do 1
Do 2
Do 3
Do a
Do b
Do c
End Sub
and call it by just writing DOTHIS in your code. The whole idea is to save space by preventing repetition.
bob
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|