Calling a subroutine using a string variable 
Author Message
 Calling a subroutine using a string variable

I have a case where I have the name of a subroutine I need to call in a
string variable, but the code below does not seem to work.

Is there any way in VB that I can accomplish this?

sub main ()
Dim strSubroutineName as String

    strSubroutineName = "test"
    call strSubroutineName

end sub

sub test()
    msgbox  "Inside test sub"
end sub

Any hints we be appreciated!!

Jason



Mon, 21 May 2001 03:00:00 GMT  
 Calling a subroutine using a string variable
In VB5 or before no. In VB6 yes -- check out the examples and help file.

Quote:
>I have a case where I have the name of a subroutine I need to call in a
>string variable, but the code below does not seem to work.

>Is there any way in VB that I can accomplish this?

>sub main ()
>Dim strSubroutineName as String

>    strSubroutineName = "test"
>    call strSubroutineName

>end sub

>sub test()
>    msgbox  "Inside test sub"
>end sub

>Any hints we be appreciated!!

>Jason




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

 Relevant Pages 

1. Is it possible to call a subroutine using a string variable with its name?

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

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

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

5. Calling functions using a String Variable

6. How do I Call Functions using String Variables

7. How do I Call Functions using String Variables

8. Calling functions using a String Variable

9. Using a String Variable to Call a Sub

10. How do I Call Functions using String Variables

11. Calling functions using a String Variable

12. How do I Call Functions using String Variables

 

 
Powered by phpBB® Forum Software