There is this usage in JS. A certain function name can be used as a parameter and passed into another function, for example:
<scripttype="text/javascript">
<!--
functionmyFuncA(str,myFuncB){
str=str+"Hello!";
str=myFuncB(str);
returnstr;
}
functionmyFuncB(str){
str=str+"Welcome to IECN.NET";
returnstr;
}
alert(myFuncA("Zhang San", myFuncB));
//-->
</script>
There are two ways to implement VBScript, namely, use execute or GetRef functions.
1. Use execute:
<scriptlanguage=vbscript>
FunctionmyFuncA(str,myFuncName)
str=str&"Hello!"
execute("str="&myFuncName&"(str)")
myFuncA=str
EndFunction
FunctionmyFuncB(str)
str=str+"Welcome to IECN.NET"
myFuncB=str
EndFunction
msgboxmyFuncA("Zhang San","myFuncB")
</script>
2. Use GetRef:
<scripttype="text/vbscript">
FunctionmyFuncA(str,myB)
str=str&"Hello!"
str=myB(str)
myFuncA=str
EndFunction
FunctionmyFuncB(str)
str=str+"Welcome to IECN.NET"
myFuncB=str
EndFunction
document.write(myFuncA("Zhang San", GetRef("myFuncB")))
</script>