Microsoft® Windows® 2000 Scripting Guide
« Previous | Next »
Scripts are often short pieces of code designed to carry out a single function. Because of this, formal documentation is not always required; the script comments usually provide sufficient information for anyone using the script. For longer scripts, however, it might be useful to provide separate documentation rather than requiring users to read through the script, searching for comments.
Well-commented scripts can actually help you write the documentation for your scripts. By including comments such as who wrote the script, when it was written, why it was written, and the purpose of procedures and functions, you already have much of the written documentation for the script as well. You only need to copy those comments from the script to the script documentation.
One way to create separate documentation for a script is to use an automated procedure to extract the comments. These comments can then serve as the basis for the written documentation. For example, the script shown in Listing 18.2 extracts comments by doing the following:
Listing 18.2 Extracting Comments
|
|
Send us your feedback | « Previous | Next » |