
VB Equivalent for Eval() {Access Basic} or Indirect() {Excel} functions
VB don't have anything that can help you, almos yet.
But, I'm implementing Sax Basic Engine (www.saxsoft.com) and it may help
you.
It's a clone of VBA and have a lot of methods and properties that allow you
to execute macros that you can store in external modules.
I recomend it!
Enjoy this help!
Quote:
> I am trying to find a way to pass execute a function or sub without
knowing
> at the time of execution what the name is. In many cases I develop
> applications which are table driven and allow the user to specify the
> functions. In Access Basic you can use vnt = Eval(sTestFunction) and
in
> Excel, Indirect(sTestFunction). There must be a way in VB. I would
> appreciate any help. Thanks
> Here's a sample:
> Sub Main()
> Dim sTestFunction as string
> sTestFunction = "Test1()"
> RunFunction sTestFunction
> End sub
> Sub RunFunction(sFunctionName as string)
> 'Execute the public function which is defined by sFunctionName
> ??????????????????
> End Sub
> Function Test1() as boolean
> Msgbox "Test1 Function"
> End Function