List of VBScript constants

From StealthBot Wiki Backup
Jump to: navigation, search

These constant values are provided with VBScript to specify arguments for built-in functions and can be typed in place of their value.

Color constants

These specify a color (Long value) you can pass to functions that want colors, such as AddChat(). The hexadecimal representation of the colors are also listed here.

  • vbBlack (0 or &H000000) - Black
  • vbRed (255 or &H0000FF) - Red
  • vbYellow (65535 or &H00FFFF) - Yellow
  • vbGreen (65280 or &H00FF00) - Lime green
  • vbCyan (16776960 or &HFFFF00) - Cyan
  • vbBlue (16711680 or &HFF0000) - Blue
  • vbMagenta (16711935 or &HFF00FF) - Magenta
  • vbWhite (16777215 or &HFFFFFF) - White

Compare mode settings

These specify how strings should be compared.

  • vbBinaryCompare (0) - Perform a binary comparison: this is a case-sensitive comparison
  • vbTextCompare (1) - Perform a textual comparison: this is a case-insensitive comparison
  • vbDatabaseCompare (2) - Perform a database comparison: uses locale settings for special characters in the comparison (this setting is often unused)

Date format settings

These specify which format to display a date in.

  • vbGeneralDate (0) - Display a date in format mm/dd/yy. If the date value contains a time, it will also be displayed.
  • vbLongDate (1) - Display a date using the long date format: weekday, month day, year
  • vbShortDate (2) - Display a date using the short date format: like the default (mm/dd/yy)
  • vbLongTime (3) - Display a time using the time format: hh:mm:ss PM/AM
  • vbShortTime (4) - Display a time using the 24-hour format: hh:mm

First day of week settings

These specify which weekday is considered the first day of a week.

  • vbUseSystemDayOfWeek (0) - Use National Language Support (NLS) API setting
  • vbSunday (1) - Sunday
  • vbMonday (2) - Monday
  • vbTuesday (3) - Tuesday
  • vbWednesday (4) - Wednesday
  • vbThursday (5) - Thursday
  • vbFriday (6) - Friday
  • vbSaturday (7) - Saturday

First week of year settings

These specify which week is considered the first week of a year.

  • vbUseSystem (0) - Use National Language Support (NLS) API setting
  • vbFirstJan1 (1) - Start with the week in which January 1 occurs
  • vbFirstFourDays (2) - Start with the week that has at least four days in the new year
  • vbFirstFullWeek (3) - Start with the first full week of the new year

Message box results

These specify the result of a message box, or which button the user clicked.

  • vbOK (1) - OK was clicked
  • vbCancel (2) - Cancel was clicked
  • vbAbort (3) - Abort was clicked
  • vbRetry (4) - Retry was clicked
  • vbIgnore (5) - Ignore was clicked
  • vbYes (6) - Yes was clicked
  • vbNo (7) - No was clicked

Message box settings

These specify binary flags for four different settings for a message box. Using the bitwise Or operator, one can combine these flags to create a message box with the desired settings.

The hexadecimal representation of the numbers are also provided to show how each setting does not conflict with others if they are combined correctly.

The first setting specifies which buttons to show:

  • vbOKOnly (0 or &H0000) - OK button only
  • vbOKCancel (1 or &H0001) - OK and Cancel buttons
  • vbAbortRetryIgnore (2 or &H0002) - Abort, Retry, and Ignore buttons
  • vbYesNoCancel (3 or &H0003) - Yes, No, and Cancel buttons
  • vbYesNo (4 or &H0004) - Yes and No buttons
  • vbRetryCancel (5 or &H0005) - Retry and Cancel buttons

The second setting specifies which icon to show:

  • vbCritical (16 or &H0010) - Critical Message icon
  • vbQuestion (32 or &H0020) - Warning Query icon
  • vbExclamation (48 or &H0030) - Warning Message icon
  • vbInformation (64 or &H0040) - Information Message icon

The third setting specifies which button is the default button:

  • vbDefaultButton1 (0 or &H0000) - First button is default
  • vbDefaultButton2 (256 or &H0100) - Second button is default
  • vbDefaultButton3 (512 or &H0200) - Third button is default
  • vbDefaultButton4 (768 or &H0300) - Fourth button is default

The fourth setting specifies window modality:

  • vbApplicationModal (0 or &H0000) - Application modal (the current application will not work until the user responds to the message box)
  • vbSystemModal (4096 or &H1000) - System modal (all applications wont work until the user responds to the message box)

Additional settings specify:

  • vbMsgBoxHelpButton (16384 or &H4000) - Show help button
  • vbMsgBoxSetForeground (65536 or &H10000) - ???
  • vbMsgBoxRight (524288 or &H40000) - Align text to the right
  • vbMsgBoxRtlReading (1048576 or &H100000) - RTL mode window (window control buttons and user buttons on the left and left-aligned)

Combine them with Or (not +) to make the flag value to pass to the message box function.

String constants

The following built-in constants provide string values.

  • vbNullString - an empty string. This is the same as passing "", but is preferred for efficiency.
  • vbNullChar - the null character (also the result of Chr(0)).
  • vbBack - the "backspace" character (result of Chr(8)).
  • vbTab - the tab character (result of Chr(9)).
  • vbLf - the "line feed" character (result of Chr(10)).
  • vbVerticalTab - the "vertical tab" character (result of Chr(11)).
  • vbFormFeed - the "form feed" character (result of Chr(12)).
  • vbCr - the "carriage return" character (result of Chr(13)).
  • vbNewLine - the new line string for the current system. On Windows systems (almost all VBScript systems), this is two characters: "carriage return" followed by "line feed".
  • vbCrLf - the Windows new line string (result of vbCr & vbLf).

Variable types

These specify variant type of VBScript variables.

  • vbEmpty (0) - Indicates Empty (uninitialized)
  • vbNull (1) - Indicates Null (no valid data)
  • vbInteger (2) - Indicates an integer (whole number)
  • vbLong (3) - Indicates a long integer
  • vbSingle (4) - Indicates a single-precision floating-point number
  • vbDouble (5) - Indicates a double-precision floating-point number (decimal number)
  • vbCurrency (6) - Indicates a currency
  • vbDate (7) - Indicates a date
  • vbString (8) - Indicates a string
  • vbObject (9) - Indicates an automation object
  • vbError (10) - Indicates an error
  • vbBoolean (11) - Indicates a Boolean (True or False)
  • vbVariant (12) - Indicates a variant
  • vbDataObject (13) - Indicates a data-access object
  • vbDecimal (14) - Indicates a decimal value
  • vbByte (17) - Indicates a byte
  • vbArray (8192) - Indicates an array: this is occasionally seen combined (using bitwise Or) with another value to specify the type of values in the array

Other constant values

These constant values are also provided for various type defaults.

  • Empty - an uninitialized value
  • Null - a value with no valid data
  • Nothing - a null object
  • True - a positive Boolean value
  • False - a negative Boolean value

And other miscellaneous constants.

  • vbObjectError - the number -2147221504 (&H80040000)

See also