Preface

Visual Basic Scripting Edition, or VBScript, as it’s commonly called, began its life amid a certain amount of fanfare as a client-side scripting language for web browsers. Its appeal was that it was a subset of Visual Basic for Applications (VBA), the most widely used programming language in the world, and hence promised to make Internet programming easy not only for the huge installed base of VB/VBA programmers, but also for new programmers as well.

But for the most part, VBScript failed to deliver on its promise as a client-side scripting language. The problem wasn’t the language or its capabilities; rather, VBScript suffered from the fact that it was the second language to arrive in the arena of client-side scripting, and was never able to supplant its rival, JavaScript. In fact, Netscape Navigator, the browser with the largest market share at the time, completely failed to support VBScript, leaving VBScript as a language that could be used exclusively for client-side scripting on corporate intranets (or for content providers on the public Internet who didn’t care that their content was incompatible with most browsers).

But while VBScript’s success as a client-side scripting language has been marginal, it has become one of the three major scripting languages (along with JavaScript and Perl) in use today. With the release of Internet Information Server (IIS) 2.0 in 1997, VBScript rapidly became the primary scripting language used in developing Active Server Pages (ASP), Microsoft’s server-side scripting technology for IIS. Also in 1997, Microsoft released the first version of Outlook, which was programmable and customizable only by using VBScript. Finally, in 1998, Microsoft released the first version of Windows Script Host (WSH), the long awaited “batch language” for Windows. Here again, VBScript rapidly emerged as the predominant choice for writing WSH scripts.

Why This Book?

The major source of documentation for VBScript is the Visual Basic Scripting HTML Help file, the official documentation that is included with VBScript itself. While VBScript’s online help is an indispensable resource that most VBScript programmers turn to first, it has a number of limitations:

  • It consistently offers a rather bare-bones approach to the language. There isn’t a level of detail that allows one to move beyond the basics or to make the documentation useful in troubleshooting and diagnosing sources of error.

  • The examples rarely, if ever, move beyond the self-evident and obvious.

  • In some cases, it incorrectly documents a feature that turns out not to work in VBScript, but that is implemented in VBA. This leads one to suspect that the documentation was originally written for VBA and then was rather quickly adapted to VBScript.

  • Since one of the strengths of VBScript is that it allows VBA programmers to leverage their existing skills in learning a new technology, it is peculiar that the documentation totally disregards differences between VBA and VBScript.

In other words, the documentation included with VBScript just doesn’t have the depth of information that you need when you need it. Most of us can get by day-to-day without even opening VBScript help. But when you need to open the help file, it’s probably because you’ve either hit an unexpected problem or need to know what the consequences of coding a particular procedure in a particular way will be. However, help tends only to show you how a function should be included in your code. This is understandable; after all, the help information for any language by their very nature must be created before that language goes into general use, but it is only general everyday use in real-life situations that highlight how the language can best be used and its problems and pitfalls. Therefore, online help confines itself to the main facts: what the syntax is and, in a general way, how you should implement the particular function or statement.

This book takes up where the help file leaves off. Contained within these pages are the experiences of professional VB and VBScript developers who have used these languages all day, every day, over many years, to create complex applications. It is these experiences from which you can benefit. Whether you have come to VBScript recently or have been using VBScript since its introduction, there are always new tricks to learn. And it’s always important to find out about the gotchas that’ll getcha!

Get VBScript in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.