【发布时间】:2012-01-20 23:27:19
【问题描述】:
我正在尝试编写类似于下面的函数的 VBScript 等效项:
object getObject(str)
{
if ( ... )
{
return object_goes_here;
}
return null;
}
我的猜测会在下面,除了我不理解 Nothing 和 Null 之间的区别。作为调用者,我宁愿测试返回值是使用IsNull()还是X Is Nothing设置的。
Function getObject(str)
If ... Then
Set getObject = object_goes_here
Exit Function
End If
Set getObject = Nothing // <-- or should this be Null?
End Function
【问题讨论】:
标签: vbscript