VBScript Constants

Top  Previous  Next

Comparison Constants
These constants are used to specify the comparision method used to compare values.

vbBinaryCompare = 0 Binary Comparison

vbTextCompare = 1 Text-based Comparison

 

MsgBox Constants
These constants are used with the MsgBox function to control it's appearance and behaviour.

For MsgBox Buttons:

vbOKOnly = 0 Show OK button only

vbOKCancel = 1 Show OK and Cancel buttons

vbAbortRetryIgnore = 2 Show Abort, Retry and Ignore buttons

vbYesNoCancel = 3 Show Yes, No and Cancel buttons

vbYesNo = 4 Show Yes and No buttons

vbRetryCancel = 5 Show Retry and Cancel buttons

For MsgBox Icon:

vbCritical = 16 Display Critical Icon

vbQuestion = 32 Display Question Icon

vbExclamation = 48 Display Exclamation Icon

vbInformation = 64 Display Infotmation Icon

String Constants
These string constants define some control strings such as newlines, tabs and carriage returns.

vbCr Chr(13) Carriage return

vbCrLf Chr(13) & Chr(10) Carriage return and linefeed combination

vbFormFeed Chr(12) Form feed

vbLf Chr(10) Line feed

vbNewLine Chr(13) & Chr(10) or Chr(10) Platform-specific newline character

vbNullChar Chr(0) Null Character

vbNullString Null String Null String - Not the same as a zero-length string ("")

vbTab Chr(9) Horizontal tab

vbVerticalTab Chr(11) Vertical tab

VarType Constants
These constants define the various subtypes of variables, and are used with the VarType() function.

vbEmpty 0 Empty (uninitialized)

vbNull 1 Null (no valid data)

vbInteger 2 Integer

vbLong 3 Long Integer

vbSingle 4 Single-precision floating-point number

vbDouble 5 Double-precision floating-point number

vbCurrency 6 Currency

vbDate 7 Date

vbString 8 String

vbObject 9 Object

vbError 10 Error

vbBoolean 11 Boolean

vbVariant 12 Variant (Used only with Arrays)

vbDataObject 13 Data-access Object

vbByte 17 Byte

vbArray 8192 Array

See Also: VarType()

Color Constants
These constants represent the standard colors built into VBScript.

vbBlack &h00 Black

vbRed &hFF Red

vbGreen &hFF00 Green

vbYellow &hFFFF Yellow

vbBlue &hFF0000 Blue

vbMagenta &hFF00FF Magenta

vbCyan &hFFFF00 Cyan

vbWhite &hFFFFFF White