如何在 VBScript 中添加注释

2023-12-02

我有一些 VBScript,我想在代码中添加我的解释。

是否有一些用于添加评论的语法?


如何在 VBScript 中注释代码?

如有疑问,请查看文档

Taken from Rem Statement
As shown in the syntax section, you can use an apostrophe (') instead of the Rem keyword. If the Rem keyword follows other statements on a line, it must be separated from the statements by a colon. However, when you use an apostrophe, the colon is not required after other statements.

下面是使用这两种方法的示例

Rem This is a comment
'This is also a comment

Call SomeFunction(SomeValue) : Rem This is an inline comment
Call SomeFunction(SomeValue) 'This is also an inline comment

没有真正的理由使用Rem it's 只是从 BASIC 回来的。在我看来,撇号方法的效果很好,而且侵入性较小,但这完全是用户的偏好。

那么块评论呢?

VBScript 不支持块注释。每行必须以以下任一开头Rem或撇号'(多种变体不会造成语法差异)。


有用的链接

  • 服务器端注释: ASP Classic 中的 相当于什么? (适用于评论经典ASP它使用vbscript)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何在 VBScript 中添加注释 的相关文章

随机推荐