Collection: ASP's function detailed explanation big summary

Source: Internet
Author: User
Tags date format empty expression month name numeric value time interval trim
function |

The function of ASP is detailed
Join (expression, "connectors")
Split: Receives the relevant parameters and makes them an array.

Array ()
FUNCTION: Returns an array
Syntax:array (list)
ARGUMENTS: Characters, numbers can be
EXAMPLE:
Result: An array containing 7 elements was created MyArray
MyArray ("Sunday", "Monday", ...) "Saturday")

CInt ()
Function: Converts an expression to a rounded integer of numeric type, related functions:
CSng Cdbl into real numbers!
  
Syntax:cint (expression)
ARGUMENTS: Any valid character can be
EXAMPLE:
result:236
The conversion character "234" is the number "234" and returns a value of 0 if the string is empty

CreateObject ()
FUNCTION: Establishes and returns an instance of a registered ActiveX component.
Syntax:createobject (objname)
Arguments:objname is the name of any valid, registered ActiveX component.
EXAMPLE:
Result:

CSTR ()
FUNCTION: Converts an expression to a string.
SYNTAX:CSTR (expression)
Arguments:expression is any valid expression.
EXAMPLE:
Result: Converts the number "5" to the character "5".

Date ()
FUNCTION: Returns the current system date.
Syntax:date ()
Arguments:none.
EXAMPLE:
Result:8/4/99

DATEADD ()
FUNCTION: Returns a date that has been changed.
Syntax:dateadd (Timeinterval,number,date)
Arguments:timeinterval is the time interval to add; Number is amount of time intervals to add; And date is the starting date.
EXAMPLE:

  
Result:11/4/99
3:34:45 PM

"M" = "month";
"D" = "Day";

If currentdate is in the time format then,
"H" = "Hour";
"S" = "second";

DateDiff ()
FUNCTION: Returns the difference between two dates.
Syntax:datediff (Timeinterval,date1,date2 [, FirstDayOfWeek [, FirstWeekOfYear]])
The arguments:timeinterval represents the type of time separated, as "M" means "month."
EXAMPLE:
Result: There are 150 days from 8/4/99 to 2000.

Day ()
FUNCTION: Returns the day ordinal of a one-month period.
Syntax:day (date)
Arguments:date is any valid date.
EXAMPLE:
Result:4

FormatCurrency ()
FUNCTION: Returns an expression that has been formatted as a currency value
Syntax:formatcurrency (Expression [, Digit [, Leadingdigit [, Paren [, Groupdigit]]]
Arguments:digit indicates the number of digits displayed to the right of the decimal point.   The default value is-1, which indicates that the computer's locale is being used; Leadingdigit a three-state constant that indicates whether to display 0 of the decimal point in the front.
EXAMPLE:
Result: $34.35

FormatDateTime ()
FUNCTION: Returns an expression that has been formatted as a date or time
Syntax:formatdatetime (Date, [, NamedFormat])
Arguments:namedformat indicates the value of the date/time format used, and if omitted, uses Vbgeneraldate.
EXAMPLE:
Result:wednesday, August 04, 1999

FormatNumber ()
FUNCTION: Returns an expression that has been formatted as a numeric value.
Syntax:formatnumber (Expression [, Digit [, Leadingdigit [, Paren [, Groupdigit]]]
Arguments:digit indicates the number of digits displayed to the right of the decimal point. The default value is-1, which indicates that the computer's locale is being used.; Leadingdigit I indicates the number of digits displayed to the right of the decimal point. The default value is-1, which indicates that the computer's locale is being used.; Paren indicates the number of digits displayed to the right of the decimal point. The default value is-1, which indicates that the computer's locale is being used.; Groupdigit I indicates the number of digits displayed to the right of the decimal point. The default value is-1, which indicates that the computer's locale is being used ...
EXAMPLE:
result:45.325

FormatPercent ()
FUNCTION: Returns an expression that has been formatted as a percentage of the trailing% symbol (multiplied by 100). (%)
Syntax:formatpercent (Expression [, Digit [, Leadingdigit [, Paren [, Groupdigit]]]
ARGUMENTS: Ditto.
EXAMPLE:
result:45.267%

Hour ()
FUNCTION: Returns the number of hours at 24 o'clock.
Syntax:hour (Time)
ARGUMENTS:
EXAMPLE:
Result:16
(Hour has been converted to 24-hour system)

Instr ()
FUNCTION: Returns the position in which a character or string appears for the first time in another string.
Syntax:instr ([Start,] strtobesearched, strsearchfor [, compare])
Arguments:start is the starting value for the search, strtobesearched accept the search string strsearchfor the character compare to search (see ASP constants in detail)
EXAMPLE:
Result:9

InStrRev ()
FUNCTION: Ditto, just from the last search of the string
Syntax:instrrev ([Start,] strtobesearched, strsearchfor [, compare])
ARGUMENTS: Ditto.
EXAMPLE:
Result:13


Int ()
FUNCTION: Returns a numeric type, not rounded.
Syntax:int (number)
ARGUMENTS:
EXAMPLE:
Result:32

IsArray ()
FUNCTION: Determines whether an object is an array and returns a Boolean value.
Syntax:isarray (name)
ARGUMENTS:
EXAMPLE:
Result:false

IsDate ()
FUNCTION: Determines whether an object is a date and returns a Boolean value
Syntax:isdate (expression)
Arguments:expression is any valid expression.
EXAMPLE:
Result:true

IsEmpty ()
FUNCTION: Determines whether an object is initialized and returns a Boolean value.
Syntax:isempty (expression)
ARGUMENTS:
EXAMPLE:
Result:true

IsNull ()
FUNCTION: Determines whether an object is empty and returns a Boolean value.
Syntax:isnull (expression)
ARGUMENTS:
EXAMPLE:
Result:false

IsNumeric ()
FUNCTION: Determines whether an object is a number and returns a Boolean value.
Syntax:isnumeric (expression)
ARGUMENTS:
EXAMPLE:
Result:true
Even if the number is quoted, the ASP thinks it is a number.

IsObject ()
FUNCTION: Determines whether an object is an object and returns a Boolean value.
Syntax:isobject (expression)
ARGUMENTS:
EXAMPLE:
Result:true

LBound ()
FUNCTION: Returns the smallest available subscript for the specified array dimension.
Syntax:lbound (Arrayname [, Dimension])
ARGUMENTS:; Dimension the integer that indicates which dimension lower bound to return. Using 1 means the first dimension, 2 represents the second dimension, and so on. If the dimension argument is omitted, the default value is 1.
EXAMPLE:
result:0

LCase ()
FUNCTION: Returns the lowercase form of a string
Syntax:lcase (String)
Arguments:string is any valid string expression.
EXAMPLE:
Result:this is a test!

Left ()
FUNCTION: Returns the previous character (including the length character) of the length of the character on the left of the string.
Syntax:left (string, length)
ARGUMENTS:
EXAMPLE:
Result:thi

Len ()
FUNCTION: Returns the length of the string.
Syntax:len (String | varName)
ARGUMENTS:
EXAMPLE:
Result:15

LTrim ()
FUNCTION: Removes the space on the left side of the string.
Syntax:ltrim (String)
ARGUMENTS:
EXAMPLE:
Result:this is a test!

Mid ()
FUNCTION: Returns a string of a specific length, from start to length.
Syntax:mid (String, start [, length])
ARGUMENTS:
EXAMPLE:
Result:today

Minute ()
FUNCTION: Returns the minute Kushiro of time.
Syntax:minute (Time)
ARGUMENTS:
EXAMPLE:
Result:45

Month ()
FUNCTION: Returns the date.
Syntax:month (date)
Arguments:date is any valid date expression.
EXAMPLE:
Result:8

MonthName ()
Function:returns A string identifying the specified month.
Syntax:monthname (month, [, ABB])
Arguments:month is the numeric representation for a given month; ABB (optional) is a Boolean value used to display month abbreviation. True would display the abbreviated month name and False (default) won't show the abbreviation.
EXAMPLE:
Result:august

Now ()
Function:returns the current system date and time.
Syntax:now ()
Arguments:none
EXAMPLE:
RESULT:8/4/99 9:30:16 AM

Replace ()
Function:returns a string in which a specified sub-string has been replaced with another substring a specified number of Times.
Syntax:replace (strtobesearched, strSearchFor, strReplaceWith [, start [, Count [, compare]])
Arguments:strtobesearched is a string expression containing a sub-string to be replaced; strSearchFor is the string expression to search for within strtobesearched; strReplaceWith is the string expression to replace sub-string strsearchfor; Start (optional) is the numeric character position to begin search; COUNT (optional) is a value indicating the comparision constant.
EXAMPLE:
Result:this is an orange!

Right ()
FUNCTION: Returns the previous character (including the length of the character) of the length of the character on the right of the string.
Syntax:right (string, length)
ARGUMENTS:.
EXAMPLE:
result:st!

Rnd ()
FUNCTION: Produces a random number.
Syntax:rnd [(number)]
ARGUMENTS:
EXAMPLE:
Result: Any number between 0 and 1

Round ()
FUNCTION: Returns a value that is rounded by a specified number of digits.
Syntax:round (expression [, numright])
The arguments:numright number indicates how many digits to the right of the decimal point are rounded. If omitted, the Round function returns an integer.
EXAMPLE:
Result:32

Rtrim ()
FUNCTION: Removes the string to the right of the string.
Syntax:rtrim (String)
ARGUMENTS:
EXAMPLE:
Result:this is a test!!

Second ()
FUNCTION: Returns a second.
Syntax:second (Time)
ARGUMENTS:.
EXAMPLE:
Result:28

StrReverse ()
FUNCTION: Back-row A string
Syntax:strreverse (String)
ARGUMENTS:
EXAMPLE:
Result:!! Tset a Si siht

Time ()
FUNCTION: Returns the system time.
Syntax:time ()
ARGUMENTS:.
EXAMPLE:
Result:9:58:28 AM

Trim ()
FUNCTION: Remove the space around the string.
Syntax:trim (String)
Arguments:string is any valid string expression.
EXAMPLE:
Result:this is a test!!

UBound ()
FUNCTION: Returns the maximum available subscript for the specified array dimension.
Syntax:ubound (Arrayname [, Dimension])
ARGUMENTS:; Dimension (optional) specifies the integer that returns the upper bound of the dimension. 1 represents the first dimension, 2 represents the second dimension, and so on. If the dimension argument is omitted, the default value is 1.
EXAMPLE:
Result:2

UCase ()
FUNCTION: Returns the uppercase form of a string.
Syntax:ucase (String)
ARGUMENTS:
EXAMPLE:
Result:this is A test!!

VarType ()
FUNCTION: Returns a value indicating the variable quantum type
Syntax:vartype (VarName)
ARGUMENTS:
EXAMPLE:
Result:2 (number) See "ASP Constant"

Weekday ()
FUNCTION: Returns the day ordinal of a week.
Syntax:weekday (date [, FirstDayOfWeek])
ARGUMENTS:.
EXAMPLE:
Result:4 (Wednesday)

WeekdayName ()
FUNCTION: Returns the name of the day ordinal of a week.
Syntax:weekdayname (Weekday [, ABB [, FirstDayOfWeek]])
Arguments:abb Optional. Boolean value that indicates whether the name of the day of the week is abbreviated. If omitted, the default value is False, that is, the name of the day of the week is not abbreviated. FirstDayOfWeek Specify the first day of the week
EXAMPLE:
Result:wednesday

Year ()
FUNCTION: Returns the current year.
Syntax:year (date)
ARGUMENTS:
EXAMPLE:
result:1999



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.