在VBScript中實現(xiàn)函數(shù)的方法
在JS中有這種用法,某個函數(shù)名可以當(dāng)成參數(shù)的形式,傳入到另外一個函數(shù)內(nèi)部去,例如:
在VBScript有兩種方式可以來實現(xiàn),即用execute或GetRef函數(shù)。
一、利用execute:
FunctionmyFuncA(str,myFuncName)
str=str&"您好!"
execute("str="&myFuncName&"(str)")
myFuncA=str
EndFunction
FunctionmyFuncB(str)
str=str+"歡迎來到IECN.NET"
myFuncB=str
EndFunction
msgboxmyFuncA("張三","myFuncB")
二、利用GetRef:
FunctionmyFuncA(str,myB)
str=str&"您好!"
str=myB(str)
myFuncA=str
EndFunction
FunctionmyFuncB(str)
str=str+"歡迎來到IECN.NET"
myFuncB=str
EndFunction
document.write(myFuncA("張三",GetRef("myFuncB")))
【在VBScript中實現(xiàn)函數(shù)的方法】相關(guān)文章:
1.VBScript中字節(jié)數(shù)據(jù)操作函數(shù)