Appendix B. VBScript Constants

What follows is a series of tables listing the intrinsic constants supported by VBScript and their values. Note that, because the constants are part of the VBScript language, you don’t have to define them using the Const statement.

Color Constants

These constants represent the values returned by RGB for standard colors:

Constant

Value

Description

vbBlack

0

Black

vbRed

255

Red

vbGreen

65280

Green

vbYellow

65535

Yellow

vbBlue

16,711,680

Blue

vbMagenta

16,711,935

Magenta

vbCyan

16,776,960

Cyan

vbWhite

16,777,215

White

Comparison Constants

The comparison constants are used by a number of functions (Filter, StrComp, Split, and Replace), as well as by the CompareMode property of the Dictionary object, to determine whether astring comparison should be case-sensitive or not:

Constant

Value

Description

vbBinaryCompare

0

Binary (case-sensitive comparison)

vbTextCompare

1

Text (case-insensitive comparison)

vbDatabaseCompare

2

Database (unused in VBScript)

Date and Time Constants

A number of functions (DateDiff, DatePart, Weekday, and WeekdayName) have a FirstDayOfWeek parameter whose value can be one of the day of the week constants (vbSunday through vbSaturday) as well as vbUseSystemDayOfWeek.

The DateDiff and DatePart functions also have a FirstWeekOfYear parameter whose value can be vbUseSystem, vbFirstJan1, vbFirstFourDays, or vbFirstFullWeek.

Constant

Value

Description

vbSunday

1

Sunday

vbMonday

2

Monday

vbTuesday

3

Tuesday

vbWednesday

4

Wednesday

vbThursday

5

Thursday

vbFriday ...

Get VBScript in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.