0

ASP 中是否存在与 PHP 等效的函数function_exists()

相当于怎么样call_user_func()

4

1 回答 1

2

你可以用一个技巧来做到这一点:

public function getFunction(functionName)
    set getFunction = nothing
    on error resume next
    set getFunction = getRef(functionName)
    on error goto 0
end function

dim func : set func = getFunction("myFunction")
if not func is nothing then
    ' call "myFunction"
    func
else
    ' "myFunction" does not exist
end if
于 2013-01-24T10:06:50.567 回答