Built-In Functions in VBScript


Some built-in functions are shown here in detail. The rest of the built-in functions are listed at the end of this document. It is only necessary to be aware that a function for a specific requirement actually exists. Descriptions of all these functions are available online or in more detailed reference manuals.

String Functions

FunctionPurpose
UCaseConverts to uppercase
LCaseConverts to lower case
LeftExtracts left (string, n) part of string for the first n characters from the left
RightExtracts right (string, n) part of string for the first n characters from the right
MidExtracts mid (string, n1, n2) from n1 characters to n2 characters

Math Functions

FunctionPurpose
IntTruncates any value to an integer
RndProduces a random number

Date and Time Functions

FunctionExample
Now10/20/1999 01:33:48 AM
Date10/20/1999
Time01:33:48 AM
Year1999
Month10
MonthNameOctober
Year1999

Dialog Boxes

There are a number of dialog boxes available.

MsgBox and InputBox Parameters

ParameterPurpose
buttonsA comma delimited list of the buttons that appear in the dialog box
titleDialog box title
helpfileDisplay the file name providing online help
contextDisplays the context from which the user is accessing the help file

MsgBox and InputBox Return Values

ButtonReturn Value
vbOKOK button clicked
vbCancelCancel button clicked
vbAbortAbort button clicked
vbRetryRetry button clicked
vbIgnoreIgnore button clicked
vbYesYes button clicked
vbNoNo button clicked

VBScript Built-In Functions