|
-
Jan 21st, 2000, 04:07 AM
#1
Thread Starter
New Member
I find the VB Help very Cumbersome and difficult to use and understand - it seems to talk in Martian at least not in a way that someone new to VB can easily interperet
Reading books is all very well if you have the time and concentration of monks
Anyway I think I can get my head around the notion of code reuse but how does this migrate to my form
-
Jan 21st, 2000, 04:13 AM
#2
Hyperactive Member
If I understand what you asking, basically, sing modules( ie functions) allows you to put often used chunks of code into functions. Then, instead of retyping this code over and over, you just call the function. Also, it allows you to seperate your code into logical parts. It makes it easier to maintain and to read. Hope this makes it a little more clear.
-
Jan 21st, 2000, 04:22 AM
#3
Lively Member
In a nutshell:
Public Sub YourSub()
'Code goes here
End Sub
Now when you want to use this in a form later, (say attached to a command button that you've changed the forecolor on ;P)
you would have the following:
Private Sub cmdButton_Click()
Call YourSub
End Sub
[This message has been edited by JohnAtWork (edited 01-21-2000).]
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
|