Friday, July 1, 2011

VB Script Built-in Functions


Function
Description
Converts a valid date and time expression to the variant of subtype Date
e.g. CDate(date)
Returns the current system date
Returns a date to which a specified time interval has been added
Returns the number of intervals between two dates
Returns the specified part of a given date
Returns the date for a specified year, month, and day
Returns a date
Returns a number that represents the day of the month (between 1 and 31, inclusive)
Returns an expression formatted as a date or time
Returns a number that represents the hour of the day (between 0 and 23, inclusive)
Returns a Boolean value that indicates if the evaluated expression can be converted to a date
Returns a number that represents the minute of the hour (between 0 and 59, inclusive)
Returns a number that represents the month of the year (between 1 and 12, inclusive)
Returns the name of a specified month
Returns the current system date and time
Returns a number that represents the second of the minute (between 0 and 59, inclusive)
Returns the current system time
Returns the number of seconds since 12:00 AM
Returns the time for a specific hour, minute, and second
Returns a time
Returns a number that represents the day of the week (between 1 and 7, inclusive)
Returns the weekday name of a specified day of the week
Returns a number that represents the year
b.    Conversion Functions:
Function
Description
Converts the first letter in a string to ANSI code
Converts an expression to a variant of subtype Boolean
Converts an expression to a variant of subtype Byte
Converts an expression to a variant of subtype Currency
Converts a valid date and time expression to the variant of subtype Date
Converts an expression to a variant of subtype Double
Converts the specified ANSI code to a character
Converts an expression to a variant of subtype Integer
Converts an expression to a variant of subtype Long
Converts an expression to a variant of subtype Single
Converts an expression to a variant of subtype String
Returns the hexadecimal value of a specified number
Returns the octal value of a specified number
c.     Format Functions:
Function
Description
Returns an expression formatted as a currency value
Returns an expression formatted as a date or time
Returns an expression formatted as a number
Returns an expression formatted as a percentage
d.    Math Functions:
Function
Description
Returns the absolute value of a specified number
Returns the arctangent of a specified number
Returns the cosine of a specified number (angle)
Returns e raised to a power
Returns the hexadecimal value of a specified number
Returns the integer part of a specified number
Returns the integer part of a specified number
Returns the natural logarithm of a specified number
Returns the octal value of a specified number
Returns a random number less than 1 but greater or equal to 0
Returns an integer that indicates the sign of a specified number
Returns the sine of a specified number (angle)
Returns the square root of a specified number
Returns the tangent of a specified number (angle)
e.     Array Functions:
Function
Description
Returns a variant containing an array
Returns a zero-based array that contains a subset of a string array based on a filter criteria
Returns a Boolean value that indicates whether a specified variable is an array
Returns a string that consists of a number of substrings in an array
Returns the smallest subscript for the indicated dimension of an array
Returns a zero-based, one-dimensional array that contains a specified number of substrings
e.g. Split(expression[,delimiter[,count[,compare]]]) where count: Optional. The number of substrings to be returned. -1 indicates that all substrings are returned, compare: 0 = vbBinaryCompare. 1= vbTextCompare
Returns the largest subscript for the indicated dimension of an array
f.     String Function:
Function
Description
Returns the position of the first occurrence of one string within another. The search begins at the first character of the string
e.g. InStr([start,]string1,string2[,compare]) where start: Optional. Specifies the starting position for each search. The search begins at the first character position (1) by default. This parameter is required if compare is specified, string1: Required. The string to be searched, string2: Required. The string expression to search for, compare: 0 = vbBinaryCompare. 1= vbTextCompare
Returns the position of the first occurrence of one string within another. The search begins at the last character of the string
Converts a specified string to lowercase
Returns a specified number of characters from the left side of a string
e.g. Left(string,length)
Returns the number of characters in a string
Removes spaces on the left side of a string
e.g. LTrim(string)
Removes spaces on the right side of a string
Removes spaces on both the left and the right side of a string
e.g. Trim(string)
Returns a specified number of characters from a string
e.g. Mid(string,start[,length])
Replaces a specified part of a string with another string a specified number of times
e.g. Replace(string,find,replacewith[,start[,count[,compare]]])where string: Required. The string to be searched, find: Required. The part of the string that will be replaced, replacewith: Required. The replacement substring, start: Optional. Specifies the start position. Default is 1. All characters before the start position will be removed., count: Optional. Specifies the number of substitutions to perform. Default value is -1, which means make all possible substitutions, compare: 0 = vbBinaryCompare. 1= vbTextCompare
Returns a specified number of characters from the right side of a string
Returns a string that consists of a specified number of spaces
Compares two strings and returns a value that represents the result of the comparison
Returns a string that contains a repeating character of a specified length
Reverses a string
Converts a specified string to uppercase
g.    Other Functions:
Function
Description
Creates an object of a specified type
Evaluates an expression and returns the result
e.g. Eval(expression)
Returns the current locale ID
Returns a reference to an automation object from a file
Allows you to connect a VBScript procedure to a DHTML event on your pages
Displays a dialog box, where the user can write some input and/or click on a button, and returns the contents
Returns a Boolean value that indicates whether a specified variable has been initialized or not
Returns a Boolean value that indicates whether a specified expression contains no valid data (Null)
Returns a Boolean value that indicates whether a specified expression can be evaluated as a number
Returns a Boolean value that indicates whether the specified expression is an automation object
Returns a picture object. Available only on 32-bit platforms
Displays a message box, waits for the user to click a button, and returns a value that indicates which button the user clicked
Returns a number that represents an RGB color value
Rounds a number
Returns the scripting language in use
Returns the build version number of the scripting engine in use
Returns the major version number of the scripting engine in use
Returns the minor version number of the scripting engine in use
Sets the locale ID and returns the previous locale ID
Returns the subtype of a specified variable
Returns a value that indicates the subtype of a specified variable

No comments: