Call a Subroutine

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SenileOwl
    New Member
    • Feb 2008
    • 27

    Call a Subroutine

    I'm working in Visual Basic .NET 2005

    I'm creating a program that could potentially hold 50 or more subroutines. However, I will only be calling three or four of the subroutines at a time. I would like to be able to hold the names of the subroutines I want to call inside of an array. However I don't know how to convert the string name into a form that I can call the subroutine with. This is the code that I'm trying to make work

    Code:
    Sub Load(ByVal Tables() As String, ByVal name As String, ByVal password As String)
    
            Dim Table As String
            For Each Table In Tables
                Table(name, password) 'This is where I want to call the subroutine
            Next
        End Sub

    P.S. I can accomplish what I want by creating a long Select Case and I will probably stick with it, but I would still like to know how to call a subroutine using a string for the name
    Last edited by SenileOwl; Apr 17 '08, 09:22 PM. Reason: Forgot to add the bottom
Working...