
Calling a function/sub when a variable holds the name
I would like to construct the name of a subroutine or a
function in a variable then execute the sub/function.
For example:
/* Example 1: */
/* Trying to call function by name in a variable */
Dim c as Control, FunctionName as String
for each c in me.Controls
if ( c.AccessibleRole = AccessibleRole.Text )
FunctionName = c.Name & "_Validate"
call FunctionName
End If
Next
/* End example 1 */
Alternatively, I could create an array of FunctionName(s)
and AddessOf(s)... but then how can I execute a function
based on the AddressOf that function?
Any ideas?
Thanks for your time,
Patrick