VBScript Glossary
VBScript Glossary
ActiveX control
ActiveX control
An object that you place on a form to enable or enhance a user's interaction An object that you place on a form to enable or enhance a user's interaction with an application. ActiveX controls have events
with an application. ActiveX controls have events and can be incorporated intoand can be incorporated into other controls. The controls have an .ocx file
other controls. The controls have an .ocx file name extension.name extension.
ActiveX object
ActiveX object
An object that is exposed to
An object that is exposed to other applications or programming tools throughother applications or programming tools through Automation interfaces.
Automation interfaces.
Argument
Argument
A constant, variable, or expression passed to a
A constant, variable, or expression passed to a procedure.procedure.
Array
Array
A set of sequentially indexed elements having the same type of data. Each A set of sequentially indexed elements having the same type of data. Each element of an array has a unique identifying index number. Changes made to element of an array has a unique identifying index number. Changes made to one element of an array do not affect the other elements.
one element of an array do not affect the other elements.
ASCII Character Set
ASCII Character Set
American Standard Code for Information Interchange (ASCII) 7-bit character American Standard Code for Information Interchange (ASCII) 7-bit character set widely used to represent letters and
set widely used to represent letters and symbols found on a standard U.S.symbols found on a standard U.S. keyboard. The ASCII character set is the same
keyboard. The ASCII character set is the same as the first 128 characters (0–as the first 128 characters (0– 127) in the ANSI character set.
127) in the ANSI character set.
Automation object
Automation object
An object that is exposed to
An object that is exposed to other applications or programming tools throughother applications or programming tools through Automation interfaces.
Automation interfaces.
Bitwise comparison
Bitwise comparison
A bit-by-bit comparison of identically positioned bits
A bit-by-bit comparison of identically positioned bits in two numericin two numeric expressions.
expressions.
Boolean expression
Boolean expression
An expression that evaluates to either
An expression that evaluates to either TrueTrue oror FalseFalse..
By reference
By reference
A way of passing the address, rather than the value, of an argument to a A way of passing the address, rather than the value, of an argument to a procedure. This allows the procedure to access the actual variable.
procedure. This allows the procedure to access the actual variable. As aAs a
result, the variable's actual value can be changed by the procedure to which it result, the variable's actual value can be changed by the procedure to which it is passed.
A way of passing the value, rather than the address, of an argument to a A way of passing the value, rather than the address, of an argument to a procedure. This allows the procedure to access a copy of
procedure. This allows the procedure to access a copy of the variable. As athe variable. As a result, the variable's actual value
result, the variable's actual value can't be changed by the can't be changed by the procedure to whichprocedure to which it is passed.
it is passed.
character code
character code
A number that represents a particular character in
A number that represents a particular character in a set, such as the ASCIIa set, such as the ASCII character set.
character set.
Class
Class
The formal definition of an object. The class acts as the template from which The formal definition of an object. The class acts as the template from which an instance of an object is created at run time. The class defines the
an instance of an object is created at run time. The class defines the properties of the object and the
properties of the object and the methods used to control the object'smethods used to control the object's behavior.
behavior.
Class module
Class module
A module containing the definition of a class (its property and method A module containing the definition of a class (its property and method definitions).
definitions). Collection
Collection
An object that contains a
An object that contains a set of related objects. An object's position in set of related objects. An object's position in thethe collection can change whenever a change occurs in the
collection can change whenever a change occurs in the collection; therefore,collection; therefore, the position of any specific object in the collection may vary.
the position of any specific object in the collection may vary.
Comment
Comment
Text added to code by a programmer that explains how the code works. In Text added to code by a programmer that explains how the code works. In Visual Basic Scripting Edition, a comment line generally starts with an Visual Basic Scripting Edition, a comment line generally starts with an apostrophe (
apostrophe (''), or you can use the ), or you can use the keywordkeyword RemRem followed by a space.followed by a space.
Comparison operator
Comparison operator
A character or symbol indicating a
A character or symbol indicating a relationship between two or more values orrelationship between two or more values or expressions. These operators include less than (<), less than or equal
expressions. These operators include less than (<), less than or equal toto (<=), greater than (>), greater than or equal
(<=), greater than (>), greater than or equal to (>=), not equal (<>), andto (>=), not equal (<>), and equal (=).
equal (=). Is
Is is also a comparison operator, but is also a comparison operator, but it is used exclusively for determining if it is used exclusively for determining if one object reference is the same as
one object reference is the same as another.another.
Constant
Constant
A named item that retains a constant value throughout the execution of a A named item that retains a constant value throughout the execution of a program. Constants can be used anywhere in your code in
program. Constants can be used anywhere in your code in place of actualplace of actual values. A constant can be a
values. A constant can be a string or numeric literal, another constant, or anystring or numeric literal, another constant, or any combination that includes arithmetic or logical
combination that includes arithmetic or logical operators exceptoperators except IsIs andand exponentiation. For example:
exponentiation. For example: Const A = "MyString" Const A = "MyString"
Data ranges
Data ranges
Each Variant subtype has a specific range of allowed values: Each Variant subtype has a specific range of allowed values: S
Suubbttyyppee RRaannggee Byte
Byte 0 to 255.0 to 255. B
Boooolleeaann TTrruuee oror FalseFalse.. Integer
Integer -32,768 to 32,767.-32,768 to 32,767. Long
Long -2,147,483,648 to 2,147,483,647.-2,147,483,648 to 2,147,483,647. Single
Single -3.402823E38 to -1.401298E-45 for negative values;-3.402823E38 to -1.401298E-45 for negative values; 1.401298E-45 to 3.402823E38 for positive values. 1.401298E-45 to 3.402823E38 for positive values. Double
Double -1.79769313486232E308 to -4.94065645841247E-324 for-1.79769313486232E308 to -4.94065645841247E-324 for negative values; 4.94065645841247E-324 to
negative values; 4.94065645841247E-324 to 1.79769313486232E308 for positive values. 1.79769313486232E308 for positive values. Currency
Currency -922,337,203,685,477.5808 to 922,337,203,685,477.5807.-922,337,203,685,477.5808 to 922,337,203,685,477.5807. Date
Date January 1, 100 to December 31, January 1, 100 to December 31, 9999, inclusive.9999, inclusive. Object
Object AnyAny ObjectObject reference.reference. String
String Variable-length strings may range in length from 0 toVariable-length strings may range in length from 0 to approximately 2 billion characters.
approximately 2 billion characters.
Date expression
Date expression
Any expression that can be interpreted as
Any expression that can be interpreted as a date. This includes anya date. This includes any
combination of date literals, numbers that look like dates, strings that look combination of date literals, numbers that look like dates, strings that look like dates, and dates
like dates, and dates returned from functions. A date expression is limited toreturned from functions. A date expression is limited to numbers or strings, in any combination, that can
numbers or strings, in any combination, that can represent a date fromrepresent a date from January 1, 100 through December 31, 9999.
January 1, 100 through December 31, 9999.
Dates are stored as part of a real number. Values to the left of the
Dates are stored as part of a real number. Values to the left of the decimaldecimal represent the date; values to the right of the decimal represent the time. represent the date; values to the right of the decimal represent the time. Negative numbers represent dates prior to December 30,
Negative numbers represent dates prior to December 30, 1899.1899.
Date literal
Date literal
Any sequence of characters with a valid
Any sequence of characters with a valid format that is surrounded by numberformat that is surrounded by number signs (#). Valid formats include the date format specified by the locale
signs (#). Valid formats include the date format specified by the locale settings for your code or the universal date
settings for your code or the universal date format. For example, #12/31/99#format. For example, #12/31/99# is the date literal
is the date literal that represents December 31, 1999, where English-U.S. isthat represents December 31, 1999, where English-U.S. is the locale setting for your application.
the locale setting for your application.
In VBScript, the only recognized format is US-ENGLISH, regardless of In VBScript, the only recognized format is US-ENGLISH, regardless of thethe actual locale of the
Date separators
Date separators
Characters used to separate the day, month, and year when date values are Characters used to separate the day, month, and year when date values are formatted.
formatted.
Empty
Empty
A value that indicates that no beginning value has been assigned to a A value that indicates that no beginning value has been assigned to a variable.
variable. EmptyEmpty variables are 0 in a numeric context, or zero-length in avariables are 0 in a numeric context, or zero-length in a string context.
string context.
Error number
Error number
A whole number in the range
A whole number in the range 0 to 65,535, inclusive, that corresponds to the0 to 65,535, inclusive, that corresponds to the Number
Number property of theproperty of the ErrErr object. When combined with theobject. When combined with the NameName propertyproperty of the
of the ErrErr object, this number represents a particular error message.object, this number represents a particular error message.
Expression
Expression
A combination of keywords, operators, variables, and constants that yield A combination of keywords, operators, variables, and constants that yield aa string, number, or object. An expression can perform a calculation,
string, number, or object. An expression can perform a calculation, manipulate characters, or test data.
manipulate characters, or test data.
Intrinsic constant
Intrinsic constant
A constant provided by an application.
A constant provided by an application. Because you can't disable intrinsicBecause you can't disable intrinsic constants, you can't create a user-defined constant with the
constants, you can't create a user-defined constant with the same name.same name.
Keyword
Keyword
A word or symbol recognized as part
A word or symbol recognized as part of the VBScript language; for example, aof the VBScript language; for example, a statement, function name, or operator.
statement, function name, or operator.
Locale
Locale
The set of information that
The set of information that corresponds to a given language and corresponds to a given language and country. Acountry. A locale affects the language of predefined programming terms and locale affects the language of predefined programming terms and locale-specific settings. There are two contexts where locale information is specific settings. There are two contexts where locale information is important:
important:
•
• The code locale affects the The code locale affects the language of terms such as keywordslanguage of terms such as keywords
and defines locale-specific settings such as the
and defines locale-specific settings such as the decimal and listdecimal and list separators, date formats, and character sorting order.
separators, date formats, and character sorting order.
•
• The system locale affects the way The system locale affects the way locale-aware functionalitylocale-aware functionality
behaves, for example, when you display
behaves, for example, when you display numbers or convert strings tonumbers or convert strings to dates. You set the system locale using the Control Panel utilities
dates. You set the system locale using the Control Panel utilities provided by the operating system.
Nothing
Nothing
The special value that indicates that an object variable is no longer associated The special value that indicates that an object variable is no longer associated with any actual object.
with any actual object.
Null
Null
A value indicating that a variable contains no valid data.
A value indicating that a variable contains no valid data. NullNull is the result of:is the result of:
•
• An explicit assignment of An explicit assignment of NullNull to a variable.to a variable. •
• Any operation between expressions that containAny operation between expressions that contain NullNull..
Numeric expression
Numeric expression
Any expression that can be evaluated as a number. Elements of the Any expression that can be evaluated as a number. Elements of the
expression can include any combination of keywords, variables, constants, expression can include any combination of keywords, variables, constants, and operators that result in a
and operators that result in a number.number.
Object type
Object type
A type of object exposed by an application, for example, Application, File, A type of object exposed by an application, for example, Application, File, Range, and Sheet. Refer to
Range, and Sheet. Refer to the application's documentation (Microsoft Excel,the application's documentation (Microsoft Excel, Microsoft Project, Microsoft Word, and so on) for a
Microsoft Project, Microsoft Word, and so on) for a complete listing of complete listing of available objects.
available objects.
pi
pi
Pi is a mathematical constant equal to approximately 3.1415926535897932. Pi is a mathematical constant equal to approximately 3.1415926535897932.
Private
Private
Variables that are visible only to the script in which they are declared. Variables that are visible only to the script in which they are declared.
Procedure
Procedure
A named sequence of statements executed as a
A named sequence of statements executed as a unit. For example,unit. For example, FunctionFunction and
and SubSub are types of procedures.are types of procedures.
Procedure level
Procedure level
Describes statements located within a
Describes statements located within a FunctionFunction oror SubSub procedure.procedure. Declarations are usually listed first, followed
Declarations are usually listed first, followed by assignments and otherby assignments and other executable code. For example:
executable code. For example:
Sub MySub() ' This statement declares a
Sub MySub() ' This statement declares a sub procedure block.sub procedure block. Dim A ' This statement
Dim A ' This statement starts the procedure block.starts the procedure block. A = "My variable"
A = "My variable" ' Procedure-level code.' Procedure-level code. Debug.Print A '
Debug.Print A ' Procedure-level code.Procedure-level code. End Sub ' This statement ends
End Sub ' This statement ends a sub procedure block.a sub procedure block. Note that script-level code resides outside any
Property
Property
A named attribute of a
A named attribute of an object. Properties define object characteristics suchn object. Properties define object characteristics such as size, color, and screen location, or
as size, color, and screen location, or the state of an the state of an object, such as enabledobject, such as enabled or disabled.
or disabled.
Public
Public
Variables declared using the
Variables declared using the PublicPublic Statement are visible to all procedures inStatement are visible to all procedures in all modules in all applications.
all modules in all applications.
Run time
Run time
The time when code is running. During run
The time when code is running. During run time, you can't edit time, you can't edit the code.the code.
Run-time error
Run-time error
An error that occurs when code is running. A run-time error results when a An error that occurs when code is running. A run-time error results when a statement attempts an invalid operation.
statement attempts an invalid operation.
Scope
Scope
Defines the visibility of a variable, procedure, or object. For example, a Defines the visibility of a variable, procedure, or object. For example, a variable declared as
variable declared as PublicPublic is visible to all procedures in all modules.is visible to all procedures in all modules. Variables declared in procedures are visible only
Variables declared in procedures are visible only within the procedure andwithin the procedure and lose their value between calls.
lose their value between calls.
SCODE
SCODE
A long integer value that is used to pass detailed information to the caller of A long integer value that is used to pass detailed information to the caller of an interface member or API function. The status
an interface member or API function. The status codes for OLE interfaces andcodes for OLE interfaces and APIs are defined in FACILITY_ITF.
APIs are defined in FACILITY_ITF.
Script level
Script level
Any code outside a procedure is referred to
Any code outside a procedure is referred to as script-level code.as script-level code.
Seed
Seed
An initial value used
An initial value used to generate pseudorandom numbers. For example, theto generate pseudorandom numbers. For example, the Randomize
Randomize statement creates a seed number used by statement creates a seed number used by thethe RndRnd function tofunction to create unique pseudorandom number sequences.
create unique pseudorandom number sequences.
String comparison
String comparison
A comparison of two sequences of characters. Unless specified in the
A comparison of two sequences of characters. Unless specified in the functionfunction making the comparison, all string comparisons are binary.
making the comparison, all string comparisons are binary. In English, binaryIn English, binary comparisons are case-sensitive; text comparisons are
String expression
String expression
Any expression that evaluates to a
Any expression that evaluates to a sequence of contiguous characters.sequence of contiguous characters. Elements of a string expression can include a
Elements of a string expression can include a function that returns a string, afunction that returns a string, a string literal, a string constant, or a string variable.
string literal, a string constant, or a string variable.
Type library
Type library
A file or component within another
A file or component within another file that contains standard descriptions of file that contains standard descriptions of exposed objects, properties, and methods.
exposed objects, properties, and methods.
Variable
Variable
A named storage location that can contain data that can be modified during A named storage location that can contain data that can be modified during program execution. Each variable has a name that uniquely identifies it within program execution. Each variable has a name that uniquely identifies it within its level of scope.
its level of scope. Variable names: Variable names:
•
• Must begin with an alphabetic character.Must begin with an alphabetic character. •
• Can't contain an embedded period Can't contain an embedded period or type-declarationor type-declaration
character. character.
•
• Must be unique within the same scope.Must be unique within the same scope. •
• Must be no longer than 255 characters.Must be no longer than 255 characters.