Executing string Function

  • Thread starter Thread starter KG
  • Start date Start date
K

KG

Hi,
Can I put a function name in a string and run that function.
For example

Function dbVersion01()
....
....
End Function

Dim strFunction as String ="DbVersion01"
Call strFunction

Something like that using delegate or some other way.

Thanks in advance
KG
 
or you could use the CallByName function:

CallByName(Me, "DbVersion01", CallType.Method, Nothing)

I believe the above works only for instance methods. You'll have to use
Reflection to execute shared methods.


Imran.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top