School of Computing  |  Napier  |  Cisco  |  SFC  |  NOS  |  Code |  Old page

ASP - Standard Functions

[Return]

The following gives the main VBScript functions:

Function

Return type description

Abs

Absolute value of a number.

Array

Variant containing an array.

Asc

ANSI character code corresponding to the first letter in a string.

Atn

Arctangent of a number.

CBool

Convert expression to a Variant of subtype Boolean.

CByte

Convert expression to a Variant of subtype Byte.

CCur

Convert expression to a Variant of subtype Currency.

CDate

Convert expression to a Variant of subtype Date.

CDbl

Convert expression to a Variant of subtype Double.

Chr

Character associated with the specified ANSI character code.

CInt

Convert expression to a Variant of subtype Integer.

CLng

Convert expression to a Variant of subtype Long.

Cos

Cosine of an angle.

CSng

Convert expression to a Variant of subtype Single.

CStr

Convert expression to a Variant of subtype String.

Date

Current system date.

DateAdd

Date to which a specified time interval has been added.

DateDiff

Number of intervals between two dates.

DatePart

Specified part of a given date.

DateSerial

Variant of subtype Date for a specified year, month, and day.

DateValue

Variant of subtype Date.

Day

Whole number between 1 and 31, inclusive, representing the day of the month.

Eval

Expression and returns the result.

Exp

e (the base of natural logarithms) raised to a power.

Filter

Zero-based array containing subset of a string array based on a specified filter criteria.

Fix

Integer portion of a number.

FormatCurrency

Expression formatted as a currency value using the currency symbol defined in the system control panel.

FormatDateTime

Expression formatted as a date or time.

FormatNumber

Expression formatted as a number.

FormatPercent

Expression formatted as a percentage (multiplied by 100) with a trailing % character.

GetObject

Automation object from a file.

GetRef

Procedure that can be bound to an event.

Hex

String representing the hexadecimal value of a number.

Hour

Whole number between 0 and 23, inclusive, representing the hour of the day.

InputBox

Displays a prompt in a dialog box, waits for the user to input text or click a button, and returns the contents of the text box.

InStr

Position of the first occurrence of one string within another.

InStrRev

Position of an occurrence of one string within another, from the end of string.

Int

Integer portion of a number.

IsArray

Boolean value indicating whether a variable is an array.

IsDate

Boolean value indicating whether an expression can be converted to a date.

IsEmpty

Boolean value indicating whether a variable has been initialized.

IsNull

Boolean value that indicates whether an expression contains no valid data (Null).

IsNumeric

Boolean value indicating whether an expression can be evaluated as a number.

IsObject

Boolean value indicating whether an expression references a valid Automation object.

Join

String created by joining a number of substrings contained in an array.

LBound

Smallest available subscript for the indicated dimension of an array.

LCase

String that has been converted to lowercase.

Left

Specified number of characters from the left side of a string.

Len

Number of characters in a string or the number of bytes required to store a variable.

LoadPicture

Picture object.

Log

Natural logarithm of a number.

LTrim

Copy of a string without leading spaces.

Mid

Specified number of characters from a string.

Minute

Whole number between 0 and 59, inclusive, representing the minute of the hour.

Month

Whole number between 1 and 12, inclusive, representing the month of the year.

MonthName

String indicating the specified month.

MsgBox

Message in a dialog box, waits for the user to click a button, and returns a value indicating which button the user clicked.

Now

Current date and time according to the setting of your computer's system date and time.

Oct

String representing the octal value of a number.

Replace

String in which a specified substring has been replaced with another substring a specified number of times.

RGB

Whole number representing an RGB color value.

Right

Specified number of characters from the right side of a string.

Rnd

Random number.

Round

Number rounded to a specified number of decimal places.

RTrim

Copy of a string without trailing spaces.

ScriptEngine

String representing the scripting language in use.

ScriptEngineBuildVersion

Build version number of the scripting engine in use.

ScriptEngineMajorVersion

Major version number of the scripting engine in use.

ScriptEngineMinorVersion

Minor version number of the scripting engine in use.

Second

Whole number between 0 and 59, inclusive, representing the second of the minute.

Sgn

Integer indicating the sign of a number.

Sin

Sine of an angle.

Space

String consisting of the specified number of spaces.

Split

Zero-based, one-dimensional array containing a specified number of substrings.

Sqr

Square root of a number.

StrComp

Value indicating the result of a string comparison.

String

Repeating character string of the length specified.

StrReverse

String in which the character order of a specified string is reversed.

Tan

Tangent of an angle.

Time

Variant of subtype Date indicating the current system time.

Timer

Number of seconds that have elapsed since 12:00 AM (midnight).

TimeSerial

Variant of subtype Date containing the time for a specific hour, minute, and second.

TimeValue

Variant of subtype Date containing the time.

Trim

Copy of a string without leading or trailing spaces.

TypeName

String that provides Variant subtype information about a variable.

UBound

Largest available subscript for the indicated dimension of an array.

UCase

String that has been converted to uppercase.

VarType

Value indicating the subtype of a variable.

Weekday

Whole number representing the day of the week.

WeekdayName

String indicating the specified day of the week.

Year

Whole number representing the year.


 

School of Computing  |  Napier  |  Cisco  |  SFC  |  NOS  |  Code |  Old page

Page maintained by bill