Appendix D. Visual Basic Constants Supported in VBScript

This appendix is primarily aimed at the Visual Basic programmer who wants to make the jump to VBScript. It covers all of the Visual Basic constants that are supported in VBScript. Constants are useful in script because they allow you to use a specific value without explicitly writing it.

Color Constants

These constants are used within script code to specify particular colors.

Constant

Value

Description

VbBlack

&h00

Black

VbRed

&Hff

Red

VbGreen

&hFF00

Green

VbYellow

&hFFFF

Yellow

VbBlue

&hFF0000

Blue

VbMagenta

&hFF00FF

Magenta

VbCyan

&hFFFF00

Cyan

VbWhite

&hFFFFFF

White

Comparison Constants

These constants are used to switch between binary or textual comparisons.

Constant

Value

Description

VbBinaryCompare

0

Perform a binary comparison.

VbTextCompare

1

Perform a textual comparison.

vbUseSystemDayOfWeek

0

Use the day of the week specified for your computer as the first day of the week.

vbFirstJan1

1

Use the week in which January 1 occurs as the first week of the year (this is the default).

VbFirstFourDays

2

Use the week that has at least four days in the new year.

VbFirstFullWeek

3

Use the first full week of the year.

Date Format Constants

These constants determine how a date is displayed.

Constant

Value

Description

VbGeneralDate

0

Displays a date and/or time. The format is determined by your system settings.

VbLongDate

1

Display a date using your system's long date format.

VbShortDate

2

Display a date using your system's short date format.

VbLongTime

3

Display a time using your system's long ...

Get VBScript Programmer's Reference, Third 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.