I have some VBScripts I would like to add my explanation to within the code.
Is there some syntax for adding a comment?
I have some VBScripts I would like to add my explanation to within the code.
Is there some syntax for adding a comment?
If in doubt, review The Documentation
Taken from Rem Statement
As shown in the syntax section, you can use an apostrophe ('
) instead of theRem
keyword. If theRem
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.
Below is example using both methods
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
There is no real reason to use Rem
it's just a throw back from BASIC. The apostrophe approach works just as well as it is less intrusive in my opinion but it is entirely user preference.
VBScript does not support block comments. Each line must start with either Rem
or an Apostrophe '
(multiple variations make no syntactical difference).