Chapter 25. Modular Script Programming
IN THIS CHAPTER
Want to do more scripting in less time? Then you need to get modular, which is what this chapter is all about. You'll learn to create code in an easy-to-reuse fashion, enabling future scripts to leverage the work you've done in the past.
Throughout this book, I advocate the use of functions and subs to encapsulate useful script routines. This type of encapsulation makes it easy to cut and paste functions and subs into future scripts, allowing you to easily reuse script code that may have taken you a while to write and debug. Cutting and pasting is great, but it has some fundamental flaws. For example, if you decide to improve a particular function, you have to improve every copy of it that you've ever made, one copy at a time. Fortunately, VBScript provides a more efficient way to reuse the functions and subs you write: Windows Script Components (WSC).
|