VBScript Tutorial
VBScript Advanced
VBScript Useful Resources
Selected Reading
- VBScript - Date
- VBScript - Arrays
- VBScript - Strings
- VBScript - Numbers
- VBScript - Cookies
- VBScript - Events
- VBScript - Loops
- VBScript - Decisions
- VBScript - Operators
- VBScript - Constants
- VBScript - Variables
- VBScript - Placement
- VBScript - Enabling
- VBScript - Syntax
- VBScript - Overview
- VBScript - Home
VBScript Advanced
- VBScript - Misc Statements
- VBScript - Error Handling
- VBScript - Reg Expressions
- VBScript - Object Oriented
- VBScript - Dialog Boxes
- VBScript - Procedures
VBScript Useful Resources
- VBScript - Discussion
- VBScript - Useful Resources
- VBScript - Quick Guide
- VBScript - Questions and Answers
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
VBScript - Object Oriented
Object Oriented VBScript
What is an Object
VBScript runtime objects help us to accomppsh various tasks. This section will help you understand how to instantiate an object and work with it.
Syntax
In order to work with objects seamlessly, we need to declare the object and instantiate it using Set Keyword.
Dim objectname Declare the object name Set objectname = CreateObject(object_type)
Example
In the below example, we are creating an object of type Scripting.Dictionary.
Dim obj Set obj = CreateObject("Scripting.Dictionary")
Destroying the Objects
The significance of destroying the Object is to free the memory and reset the object variable.
Syntax
In order to destroy the objects, we need to use Set Keyword followed by the object name and point it to Nothing.
Set objectname = Nothing Destroy the object.
Example
In the below example, we are creating an object of type Scripting.Dictionary.
Dim obj Set obj = CreateObject("Scripting.Dictionary") Set obj = Nothing.
Object Usage
Please cpck on each one of the given object types to know more.
Object Type | Description |
---|---|
Class is a container, which holds methods and variables associated with it and accessed by creating an object of Type Class. | |
It is the group of objects with which we can work with file system. | |
A Group of objects, which are used for creating the dictionary objects. | |
A Global Object with which we can send output to the Microsoft script debugger. |