Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
 
 
 
500MB 27GB Web Hosting - $9.95/Month
 
 
 
 
 
Old Pages
 
Old Index
Site Map
What's New
 
Books
How To
Tips & Tricks
Tutorials
Stories
Performance
Essays
Links
Q & A
New in VB6
Free Stuff
Pictures
 
 
 
TitleCall a subroutine by name in VB6
Keywordssubroutine, routine, VB6, CallByName
CategoriesSoftware Engineering, Tips and Tricks
 
Use the CallByName function (VB6 only).
 
Private Sub Command1_Click()
    CallSubroutine "SubA"
End Sub

Private Sub Command2_Click()
    CallSubroutine "SubB"
End Sub

Private Sub CallSubroutine(ByVal sub_name As String)
    CallByName Me, sub_name, VbMethod
End Sub

Public Sub SubA()
    MsgBox "This is SubA"
End Sub

Public Sub SubB()
    MsgBox "This is SubB"
End Sub
 
 
Copyright © 1997-2003 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated