VBScript: Multidimensional Arrays, Statements, and Commenting - Commenting Your Code
(Page 6 of 6 )
Since we don't have time to cover Loops in this article, I will instead discuss commenting. Comments are used in code to let yourself and other programmers know what a piece of code was meant to do. It helps save time when debugging and rewriting code and is a good practice.
VBScript only supports one type of commenting, and that is the single line comment. You comment on code using the single quote ('), like so:
<html>
<body>
<script type="text/vbscript">
'This code will print out "Hey nerd" to your monitor
'Look! Another comment!
document.write("Hey nerd")
</script>
</body>
</html>
When the program comes across your single quote, it ignores everything remaining on that line. It's as if everything else is too hideous for VBScript to look at. Ah well, at least VBScript doesn't run away screaming.
Well folks we've come to my favorite and your least favorite part of the article: the end. Join me next time when I talk about Loops and Functions in VBScript.
Till then...
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |