Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

passing the name of a procedure via a variable

Posted on 2006-07-10
2
Medium Priority
?
258 Views
Last Modified: 2010-04-23
what is the easiest way to perform something similar to:

****
Dim var1 as String
Call var1
****

to excecute procedure Proc1?
0
Comment
Question by:the_bachelor
2 Comments
 
LVL 2

Expert Comment

by:TheUnkind
ID: 17078172
try this one

dim proc2 as new proc1



0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 150 total points
ID: 17078240
Here's an example, using CallByName:

  Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    CallByName(Me, "Test", CallType.Method, New Object() {})

  End Sub

  Public Sub Test()
    MessageBox.Show("Test")
  End Sub

Bob
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

927 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