vbscript - 在 VBscript 中调用函数时使用 Call 有什么优点吗?

标签 vbscript

如果答案很明显,请原谅我,因为我已经很长时间没有编写 vbscript 了。

在 vbscript 中调用函数时使用 Call 有什么优点吗?

例如:

SomeFunction param1, param2

对比

Call SomeFunction (param1, param2)

最佳答案

差异如 MSDN -

To call a Sub procedure from another procedure, type the name of the procedure along with values for any required arguments, each separated by a comma. The Call statement is not required, but if you do use it, you must enclose any arguments in parentheses.

The following example shows two calls to the MyProc procedure. One uses the Call statement in the code; the other doesn't. Both do exactly the same thing.

Call MyProc(firstarg, secondarg)
MyProc firstarg, secondarg

Notice that the parentheses are omitted in the call when the Call statement isn't used.

关于vbscript - 在 VBscript 中调用函数时使用 Call 有什么优点吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/567341/

相关文章:

HTTP GET 请求,ASP - 我迷路了!

vba - VB6/VBScript 将文件编码更改为 ansi

c# - 使用显式接口(interface)实现时如何选择将哪个成员导出到COM?

javascript - 如何用脚本改变一个像素

javascript - IE 9 错误 getElementbyId : Object required

asp-classic - 在经典 ASP 中运行 ADO 事务时使用什么错误模式?

javascript - 使用 hta 根据第一个选择列表框更改第二个列表框

java - 从非工作目录查找文件的路径

powershell - Windows 产品 key - 来自不同技术的不同答案

batch-file - 确定用户是否在 UAC 提示中单击了 NO