Call Function using Func Name stored in variable 
Author Message
 Call Function using Func Name stored in variable

I want to store a function or sub name ( or reference to) in a variable.
Then I want to call this sub or function by using this variable some how.
This would allow me to pass the function name into a generic function and
call it from there.

any ideas?

George Padvorac



Mon, 07 May 2001 03:00:00 GMT  
 Call Function using Func Name stored in variable
You can use Eval

Function Hello()
  MsgBox "Hello"
End Function

Function testHello()
  Dim strFunc As String
  strFunc = "Hello()"
  Eval (strFunc)
End Function


Quote:
>I want to store a function or sub name ( or reference to) in a variable.
>Then I want to call this sub or function by using this variable some how.
>This would allow me to pass the function name into a generic function and
>call it from there.

>any ideas?

>George Padvorac




Mon, 07 May 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Help with using names and variables in a function call

2. how do i call a function by using the function name as a string of characters

3. Calling function or sub with variable array or string names

4. Call a function with a variable name

5. Calling a procedure using a variable name

6. Call Let/Get Prop using string variable for name

7. Call Let/Get Prop using string variable for name

8. Call a proc using a string variable for the proc name

9. Help Using Variable To Call a Procedure or function

10. Calling a Function using an array or variable


 
Powered by phpBB® Forum Software © phpBB Group