Set Command archives - The VBScript Network and Systems Administrator's Cafe

The VBScript Network and Systems Administrator's Cafe:

set command

Aug 1 2008   10:00PM GMT

VBScript Statements: Explanation of the Set Statement



Posted by: Jerry Lees
VBScript, VBScript Statements, Objects, set, VBScript Objects, working with objects, set command, working with variables

The set statement is used to assign any value to any type of variable. For the most part this command is optional. However, it needs to be used when you are assigning an object reference to a variable, such as when you use a variable to hold the return of a CreateObject function for later reference in your code.

An example of the set command would look like:

Option explicit
Dim objDictionary
Set objDictionary = CreateObject(”Scripting.Dictionary”)