
Calling a sub or function using a variable through another sub or function
I know, the title is a bit confusing. This is what I'm trying to do:
Create an onClick sub or function that will accept the name of a second sub
or function to be executed as a variable parameter. Is This possible?
Sample HTML:
<input type="button" value="Click Me" name="B1"
onClick=subClick("doFunction")>
' Sub called by the onClick event of the button
Sub subClick(callThis)
' Do some stuff here
' Call sub or function specified in the onClick event in the HTML
Call callThis
End Sub
' Second sub passed from the
Sub doFunction()
' This is the sub specified by the HTML in the onClick event
' Do something else here
End Sub
Hopefully, somebody has tried this before and can shed some light on this
poor script junkie. :)
- Glen