亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

在VBScript中實(shí)現(xiàn)-函數(shù)/方法名作為參數(shù)傳入另一個(gè)函數(shù)

 更新時(shí)間:2007年08月21日 23:29:23   作者:  
在JS中有這種用法,某個(gè)函數(shù)名可以當(dāng)成參數(shù)的形式,傳入到另外一個(gè)函數(shù)內(nèi)部去,例如:
<script type="text/javascript">
<!--
function myFuncA(str,myFuncB){
 str = str + " 您好!";
 str = myFuncB(str);
 return str;
}
function myFuncB(str){
 str = str + "歡迎來(lái)到IECN.NET";
 return str;
}
alert(myFuncA("張三",myFuncB));
//-->
</script>

在VBScript有兩種方式可以來(lái)實(shí)現(xiàn),即用execute或GetRef 函數(shù)。
一、利用execute:
<script language=vbscript>
Function myFuncA(str,myFuncName)
 str = str & " 您好!"
 execute("str = " & myFuncName & "(str)")
 myFuncA = str
End Function

Function myFuncB(str)
 str = str + "歡迎來(lái)到IECN.NET"
 myFuncB = str
End Function

msgbox myFuncA("張三","myFuncB")
</script>
二、利用GetRef:
<script type="text/vbscript">
Function myFuncA(str,myB)
 str = str & " 您好!"
 str = myB(str)
 myFuncA = str
End Function

Function myFuncB(str)
 str = str + "歡迎來(lái)到IECN.NET"
 myFuncB = str
End Function

document.write(myFuncA("張三",GetRef("myFuncB")))
</script>

相關(guān)文章

最新評(píng)論