Page

10.1.0- What are Scripting Objects?

Created by Brendan Doss.
Last Updated by Jim Minatel.  

PublicCategorized as 10. The Scripting Objects.

Not yet tagged
<< 10.0.0- The Scripting ObjectsChapter1010.2.0- Creating an Instance of a Scripting Object >>

What are Scripting Objects?

Scripting Objects are, quite simply, objects that can be used in any form of script, both client and server-side. This contrasts with the ASP objects, which are only available on the server. There are two sets of scripting objects that can be used in both client and server side script. The first set is known as the Scripting Runtime objects. These are provided with IIS 5.0, among other products, and are a set of objects that provide functionality that was "missed out" from Visual Basic. These objects come as part of the Scripting Runtime Objects library, which is the file scrrun.dll. The second set of objects is the VBScript objects. These come as part of VBScript itself, or rather the file vbscript.dll. This file provides the scripting language support to both ASP and Internet Explorer. Collectively these two libraries of objects are known as the Scripting Objects.

Objects that form part of the Scripting Run Time library can also be accessed from other scripting languages, such as JScript. In this book, we are creating all of our examples in VBScript, so you will need to refer to the Microsoft documentation of JScript if you want to see how to use these objects with JScript. This documentation, along with the latest information on all Microsoft scripting technologies, can be found at http://msdn2.microsoft.com/en-us/library/ms950396.aspx.

In addition, if you want more information about scripting with VBScript, Wrox has a complete book on the topical available: VBScript Programmer's Reference 3rd Edition (Wrox, 2007, ISBN:  978-0-470-16808-0).

 

We're going to look at six scripting objects that a developer can use from within their scripts (there are over twice that amount). The first that we'll consider is the Dictionary object, which allows you to store information in a single data structure for easy retrieval. It is similar to an array, and it is also similar to a collection. The FileSystemObject object provides access from an Active Server Pages script to the hard disk file system of the server. This object will allow you to work with files, as well as directories and sub-directories.

 

The TextStream object allows you to deal with the contents of a file that you have got information about using the FileSystemObject object. You can read information from the file and write data to it. These are all Scripting Runtime objects.

 

The odd one out we'll look at is the RegExp object, which comes as part of the VBScript itself. Regular expressions are something that JScript has enjoyed support of for years, and they have been added to version 5.0 of VBScript. They can be used to search for and manipulate a sequence of characters in a large amount of data. We'll first look at how you'd create an instance of a scripting object in your pages.

<< 10.0.0- The Scripting ObjectsChapter1010.2.0- Creating an Instance of a Scripting Object >>

Copyright © 2003 by Wiley Publishing, Inc.

Powered by Near-TimeTerms of Services | Privacy Policy | Security Policy |