Hi,
Outside of an Events context, can the address of a function obtained with GetRef(), be used in a variable which will later be used to execute the function?
What I'm trying to accomplish is sending the function name as parameter on the command line, and then executing that function inside the script, something like:
WScript test.vbs "FirstFunction"
Outside of an Events context, can the address of a function obtained with GetRef(), be used in a variable which will later be used to execute the function?
What I'm trying to accomplish is sending the function name as parameter on the command line, and then executing that function inside the script, something like:
WScript test.vbs "FirstFunction"
Code:
'**** Test.vbs
Option Explicit
Function ExecuteFunction( FunctionName )
Dim RetVal
RetVal = RunThis( &Function )
ExecuteFunction = RetVal
End Function
' **** All defined functions ****
Function FirstFunction
...
End Function
Function SecondFunction
...
End Function
'*** End of test.vbs ***