How to Specify Dynamic Function Name

Posted on 2009-02-12
Last Modified: 2012-05-06
How do you dynamically specify a function name at runtime? Please see the sample code below, where the elements in array arrFunc() are set to either True or False. I want the loop to dynamically call functions fncProcess1, fncProcess2, or fncProcess3, depending on the boolean value of the current array element.
Dim intElement As Integer

        Dim strResults as String

        For intElement = 1 To 3

            If arrFunc(intElement) Then

                strResults = Eval("fncProcess" & intElement)

            End If


    End Sub

Open in new window

Question by:brian_appliedcpu
    1 Comment
    LVL 59

    Accepted Solution


    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
    If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now