Sideway
output.to from Sideway
Draft for Information Only

Content

VBScript Constants and Literals
  Predefined Contstants
  Color Constants
  Comparison Constants
  Date and Time Constants
  Date Format Constants
  Miscellaneous Constants
  MsgBox Constants
  String Constants
  Tristate Constants
  VarType Constants
  Predefined Literals

VBScript Constants and Literals

Besides reserved keywords, VBScript also includes a number of predefined intrinsic constants that can be used in VBScript scripting to improve the readability of scripts by replacing  the numeric equivalents to a meaningful constants.

Predefined Contstants

Some common words are used as predefined constants for different applications and purposes.

Color Constants

Since these predefined constants are built into VBScript, these constants can be used anywhere in the code to represent the values shown for each.

ConstantValueDecimal ValueDescriptionvbBlack &h000Color BlackvbRed &hFF255Color RedvbGreen &hFF0065280Color GreenvbYellow &hFFFF65535Color YellowvbBlue &hFF000016711680Color BluevbMagenta &hFF00FF16711935Color MagentavbCyan &hFFFF0016776960Color CyanvbWhite &hFFFFFF16777215Color White

Comparison Constants

Since these predefined constants are built into VBScript, these constants can be used anywhere in the code to represent the values shown for each.

ConstantValueDescriptionvbBinaryCompare0Perform a BinaryComparevbTextCompare1Perform a TextCompare

Date and Time Constants

Since these predefined constants are built into VBScript, these constants can be used anywhere in the code to represent the values shown for each.

ConstantValueDescriptionvbSunday1SundayvbMonday2MondayvbTuesday3 TuesdayvbWednesday4WednesdayvbThursday5ThursdayvbFriday6FridayvbSaturday7SaturdayvbUseSystemDayOfWeek0Use the day of the week specified in local system settings for the first day of the week.vbFirstJan11Use the week in which January 1 occurs.vbFirstFourDays2Use the first week that has at least four days in the new year.vbFirstFullWeek3Use the first full week of the year.vbUseSystem0Use National Language Support (NLS) API setting.

Date Format Constants

Since these predefined constants are built into VBScript, these constants can be used anywhere in the code to represent the values shown for each.

ConstantValueDescriptionvbGeneralDate0Display a date and/or time using the GeneralDate format specified in local computer's system settings. For real numbers, display a date and time. If there is no fractional part, display only a date. If there is no integer part, display time only.vbLongDate1Display a date using the LongDate format specified in local computer's regional settings.vbShortDate2Display a date using the ShortDate format specified in local computer's regional settings.vbLongTime3Display a date using the LongTime format specified in local computer's regional settings.vbShortTime4Display a date using the ShortTime format specified in local computer's regional settings.

Miscellaneous Constants

Since these predefined constants are built into VBScript, these constants can be used anywhere in the code to represent the values shown for each.

ConstantValueDescriptionvbObjectError-2147221504User-defined error numbers should be greater than this value, for example, Err.Raise Number = vbObjectError + 1000

MsgBox Constants

The following constants are used with the MsgBox function to identify what buttons and icons appear on a message box and which button is the default. In addition, the modality of the MsgBox can be specified. Since these predefined constants are built into VBScript, these constants can be used anywhere in the code to represent the values shown for each.

ConstantValueDescriptionvbOKOnly0Display OK button only.vbOKCancel1Display OK and Cancel buttons.vbAbortRetryIgnore2Display Abort, Retry, and Ignore buttons.vbYesNoCancel3Display Yes, No, and Cancel buttons.vbYesNo4Display Yes and No buttons.vbRetryCancel5Display Retry and Cancel buttons.vbCritical16Display Critical Message icon.vbQuestion32Display Warning Query icon.vbExclamation48Display Warning Message icon.vbInformation64Display Information Message icon.vbDefaultButton10First button is the default.vbDefaultButton2256Second button is the default.vbDefaultButton3512Third button is the default.vbDefaultButton4768Fourth button is the default.vbApplicationModal0Application modal. The user must respond to the message box before continuing work in the current application.vbSystemModal4096System modal. On Win16 systems, all applications are suspended until the user responds to the message box. On Win32 systems, this constant provides an application modal message box that always remains on top of any other programs you may have running.

The following constants are used with the MsgBox function to identify which button a user has selected. These constants are only available when the application project has an explicit reference to the appropriate type library containing these built-in constant definitions. For VBScript, these constants must be explicitly declared in the application code.

ConstantValueDescriptionvbOK1OK button was clicked.vbCancel2Cancel button was clicked.vbAbort3Abort button was clicked.vbRetry4Retry button was clicked.vbIgnore5Ignore button was clicked.vbYes6Yes button was clicked.vbNo7No button was clicked.

String Constants

Since these predefined constants are built into VBScript, these constants can be used anywhere in the code to represent the values shown for each.

ConstantValueDescriptionvbCrChr(13)Carriage return.VbCrLfChr(13) & Chr(10)Carriage return–linefeed combination.vbFormFeedChr(12)Form feed; not useful in Microsoft Windows.vbLfChr(10)Line feed.vbNewLineChr(13) & Chr(10) or Chr(10)Platform-specific newline character; whatever is appropriate for the platform.vbNullCharChr(0)Character having the value 0.vbNullStringString having value 0Not the same as a zero-length string (""); used for calling external procedures.vbTabChr(9)Horizontal tab.vbVerticalTabChr(11)Vertical tab; not useful in Microsoft Windows.

Tristate Constants

Since these predefined constants are built into VBScript, these constants can be used anywhere in the code to represent the values shown for each.

ConstantValueDescriptionvbUseDefault-2UseDefault from computer's regional settingsvbTrue-1TruevbFalse0False

VarType Constants

These constants are only available when the application project has an explicit reference to the appropriate type library containing these built-in constant definitions. For VBScript, these constants must be explicitly declared in the application code.

ConstantValueDescriptionvbEmpty0Uninitialized (default)vbNull1Contains no valid datavbInteger2Integer subtypevbLong3Long subtypevbSingle4Single subtypevbDouble5Double subtypevbCurrency6Currency subtypevbDate7Date subtypevbString8String subtypevbObject9ObjectvbError10Error subtypevbBoolean11Boolean subtypevbVariant12Variant (used only for arrays of variants)vbDataObject13Data access objectvbDecimal14Decimal subtypevbByte17Byte subtypevbArray8192Array

Predefined Literals

Some common words are used as predefined literals with specific meanings. Since these predefined literals are built into VBScript, these constants can be used anywhere in the code to represent the values shown for each.

ConstantValueDescriptionTrueEval(True)=True
IsNumeric=True
A Boolean True
FalseEval(False)=False
IsNumeric=True
A Boolean False
NullIsNull=True
IsEmpty=False
IsObject=False
A variable contains no valid data
EmptyIsNull=False
IsEmpty=True
IsObject=False
An uninitialized variable
NothingIsNull=False
IsEmpty=False
IsObject=True
An object reference that refers to no object.

©sideway

ID: 180400013 Last Updated: 4/13/2018 Revision: 0


Latest Updated LinksValid XHTML 1.0 Transitional Valid CSS!Nu Html Checker Firefox53 Chromena IExplorerna
IMAGE

Home 5

Business

Management

HBR 3

Information

Recreation

Hobbies 8

Culture

Chinese 1097

English 339new

Travel 7new

Reference 79

Computer

Hardware 251

Software

Application 213

Digitization 32

Latex 52

Manim 205

KB 1

Numeric 19

Programming

Web 289

Unicode 504

HTML 66

CSS 65

SVG 46

ASP.NET 270

OS 431

DeskTop 7

Python 72

Knowledge

Mathematics

Formulas 8

Set 1

Logic 1

Algebra 84

Number Theory 206

Trigonometry 31

Geometry 34

Coordinate Geometry 2

Calculus 67

Complex Analysis 21

Engineering

Tables 8

Mechanical

Mechanics 1

Rigid Bodies

Statics 92

Dynamics 37

Fluid 5

Fluid Kinematics 5

Control

Process Control 1

Acoustics 19

FiniteElement 2

Natural Sciences

Matter 1

Electric 27

Biology 1

Geography 1


Copyright © 2000-2024 Sideway . All rights reserved Disclaimers last modified on 06 September 2019