ASP function details
Join (Expression, "Connect") Split: Receive the relevant parameters so that it becomes an array.
Array () Function: Returns an array syntax: array (list) arguments: characters, numbers can be elimple: <% DIM myarray () for i = 1 to 7 redim preserve myarray (i) MyArray (i) = weekdayname (i) Next%> Result: established a array of 7 elements with MyArray MyArray ("Sunday", "Monday", ... "Saturday")
CINT () function: Transform an expression into a digital type, all numbers, related functions: CSNG CDBL to implement! Syntax: Cint (Expression) arguments: Any valid character can be eXample: <% f = "234" Response.write CINT (f) 2%> Result: 236 Transformation Character "234" is a number "234", if character Return 0 value
CreateObject () Function: Establish and return an instance of a registered ActiveX component. Syntax: creteObject (objName) arguments: ObjName is the name of any valid, registered ActiveX component. EXAMPLE: <% SET Con = Server.createObject ("AdoDb.Connection")%> Result:
CSTR () Function: Transforming an expression as a string. Syntax: cstr (expression) arguments: expression is any valid expression. Example: <% s = 3 2 response.write "the result is:" & cstr (s)%> Result: Transformation Number "5" is the character "5".
Date () Function: Returns the current system date. Syntax: Date () arguments: none. EXample: <% = DATE%> Result: 8/4/99
Dateadd () Function: Returns a changed date. 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: <% currentDate = # 8/4/99 # newDate. = DateAdd ("M", 3, Currentdate) response.write newdate%>
<% Currentdate = # 12: 34: 45 PM # newdate = dateadd ("h", 3, currentdate) response.write newdate%> Result: 11/4/99 3:34:45 PM
"m" = "month"; "d" = "day"; if currentdate is in time format the, "h" = "hour"; "s" = "second";
Datediff () function: Returns the difference between the two dates. Syntax: datediff (timeInterval, Date1, Date2 [, Firstdayofweek [, Firstweekofweear]]) arguments: timeInterval indicates the type of the separation time, such as "M" means "month". EXAMPLE: <% fromDate = # 8/4/99 # Todate = # 1/1/2000 # response.write "There" & _ Datediff ("D", fromDate, Todate) & _ "Days to Millenium from 8 / 4/99. "%> Result: There are still 150 days from 8/4/99 to 2000.
Day () Function: Returns a month. Syntax: day (date) arguments: Date is any valid date. EXAMPLE: <% = day (# 8/4/99 #)%> Result: 4
FormatCurrency () Function: Return expression, this expression has been formatted as a currency value syntax: formatcurrency (Expression [, DIGIT [, LeadingDigit [, Paren [, GroupDigit]]]) arguments: Digit Indicates the right side of the decimal point Number of values. The default value is -1, indicating the area setting of the computer; the LeadingDigit tri-state constant indicates whether the zero in front of the small numerical point is displayed. EXAMPLE: <% = formatcurrency (34.3456)%> Result: $ 34.35
FormatDateTime () Function: Returns the expression, this expression is formatted as a date or time syntax: formatdatetime (Date, [, namedFormat]) arguments: namedFormat Indicates the value of the date / time format used, if omitted, use VbGeneraldDate. EXAMPLE: <% = formatdatetime ("08/4/99", vblongdate)%> Result: Wednesday, August 04, 1999
FormatNumber () Function: Return expression, this expression has been formatted to a value. Syntax: formatNumber (Expression [, DIGIT [, LeadingDigit [, Paren [, GroupDigit]]]) arguments: Digit Indicates the right display bit on the right side of the decimal point Number of values. The default is -1, indicating the area setting of the computer. LeadingDigit i indicates the value of the display bits on the right side of the decimal point. The default is -1, indicating the area setting of the computer. PAREN indicates the value of the number of digits on the right side of the decimal point. The default is -1, indicating the area setting of the computer. GroupDigit i indicates the value of the number of digits on the right side of the decimal point. The default is -1, indicating the area setting of the computer. EXAMPLE: <% = FormatNumber (45.324567, 3)%> Result: 45.325Formatpercent () function: Return expression, this expression has been formatted as a percentage of the percentage of the percentage (multiplying 100). (%) SYNTAX: FORMATPERCENT (Expression [, Digit [, LeadingDigit [, Paren [, GroupDigit]]]) Arguments: The same. EXAMPLE: <% = formatpercent (0.45267, 3)%> Result: 45.267%
Hour () Function: Returns hours in 24. Syntax: Hour (Time) arguments: example: <% = Hour (# 4: 45: 34 pm #)%> Result: 16 (Hour Has Been Converted to 24-Hour SYSTEM)
INSTR () Function: Returns the first place in another string. Syntax: INSTR ([START,] STRTOBESEARCHED, STSEARCHFOR [, Compare]) arguments: start is the starting value of the search, Strtobsearched Accepting Strings STRSEARCHFOR To search for Character Compare Comparison Method (Details) EXAMPLE: <% strText = "This Is A Test !!" POS = Instr (Strtext, "A") response.write POS%> Result : 9
INSTRREV () Function: Same as above, just from the last search of Syntax: Instrrev ([Start,] start, ":":::::: "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" " POS = INSTRREV (Strtext, "S") Response.write POS%> Result: 13
Int () function: Returns the numeric type, not rounded. SYNTAX: INT (Number) arguments: example: <% = int (32.89)%> Result: 32
Isarray () function: Determines if an object is an array, returns a Boolean value. Syntax: isarray (name) arguments: example: <% strate = "test!" Result: falseisdate () Function: FalseiSdate () Function: Judging whether an object is a date, return to Boolean syntax: isdate (expression) arguments: expression is any valid expression. EXAMPLE: <% strTest = "8/4/99" response.write isdate (strTest)%> Result: True
ISEMPTY () Function: Determines whether an object is initialized, return to Boolean value. Syntax: ISempty (Expression) arguments: example: <% DIM I response.write ISempty (i)%> Result: TRUE
ISNULL () Function: Determines if an object is empty, return to Boolean value. Syntax: isnull (expression) arguments: example: <% DIM I response.write isnull (i)%> Result: false isnumeric () Function: Judgment an object Whether it is a number, returning Boolean value. Syntax: isnumeric (expression) arguments: example: <% i = "345" response.write isnuMeric (i)%> Result: True Even if the number adds quotation marks, ASP still thinks it is a number.
IsObject () function: Determines if an object is an object, returns a Boolean value. Syntax: isobject (expression) arguments: example: <% set con = Server.createObject ("AdoDb.Connection) Response.write isobject (con)%> Result: True
LBound () Function: Returns the minimum available subscript of the specified array dimension. Syntax: lbound (arrayname [, dimension]) arguments:; Dimension indicates which one of the minimal boundaries to returns. Use 1 to represent the first dimension, 2 represents the second dimension, and so on. If the Dimension parameters are omitted, the default value is 1. EXAMPLE: <% i = array ("Monday", "Tuesday", "Wednesday") Response.write Lbound (i)%> Result: 0
LCASE () Function: Returns the lowercase form of the string Syntax: Lcase (string) arguments: string is any value value: <% string = "this is a test!" Response.write Lcase (strTrtest)%> Result: this is a test!
LEFT () function: Returns the previous character (containing ZENGTH characters) on the left side of the string (containing parameter). Syntax: Left (string, length) arguments: example: <% strate = "this is a test!" Response.write Left (strTest, 3)%> Result: thilen () Function: Returns the length of the string. Syntax: len (string | varname) arguments: example: <% strTrtest = "this is a test!" Response.write Len (strTest! " )%> Result: 15
LTRIM () Function: Remove the space left on the left side. Syntax: Ltrim (String) arguments: example: <% strTrtest = "this is a test!" Response.write Ltrim (strTRTEST)%> Result: this is a test!
MID () Function: Returns a specific length string (starting from START, length length). Syntax: MID (String, Start [, Length]) arguments: example: <% strTrtest = "this is a test! Today is Monday Response.write MID (Strtest, 17, 5)%> Result: Today
Minute () Function: Return time division. Syntax: Minute (time) arguments: example: <% = minute (# 12: 45: 32 pm #)%> Result: 45
Month () Function: Return date. Syntax: Month (Date) arguments: Date is any valid Date Expression. EXAMPLE: <% = Month (# 08/04/99 #)%> 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 Will Display The Abbreviated Month Name and false (default) WILL NOT SHOW The Abbreviation. EXAMPLE: <% = MONTHNAME (MONTH (# 08/04/99 #))%> Result: August
Now () function: returns the current system date and time. Syntax: now () arguments: none example: <% = no%> Result: 8/4/99 9:30:16 AM
Replace () FUNCTION: Returns a string in which a specified substring 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 indeicating the comparision constant. EXAMPLE: <% strate = "this is an apple!" Response.write Replace (StRTEST, "Apple", "Orange")%> Result: this is an an anal! Right () Function: Returns the character (containing ZENGTH characters) in the right side of the string (including ZENGTH characters). SYNTAX: Right (string, length) arguments:. Example: <% strTrtest = "this is an test!" Response. Write Right (strTest, 3)%> Result: ST!
RND () Function: Generate a random number. Syntax: RND [(Number)] arguments: example: <% randomize () response.write rnd ()%> Result: Number of numbers between 0 and 1
Round () Function: Returns the value of the number of points to the number. Syntax: Round (Expression [, Numright]) arguments: Numright figure indicates how many counts in the right side of the decimal point. If omitted, the ROUND function returns an integer. EXAMPLE: <% i = 32.45678 response.write round (i)%> Result: 32
RTRIM () Function: Remove the string on the right side of the string. SYNTAX: RTRIM (String) arguments: example: <% strate = "this is a test !!" Response.write RTRIM (strTRTEST)%> Result: this is a test !!
Second () Function: Return second. Syntax: second (time) arguments:. Example: <% = second (# 12: 34: 28 pm #)%> Result: 28
STRREVERSE () Function: A string syntax: strreverse (string) arguments: example: <% strTrtest = "this is a test !!" response.write strreverse (strTrtest)%> Result: !! Tset A Si Sihttime Function: Return to the system time. Syntax: Time () arguments:. Example: <% = time%> Result: 9:58:28 am
Trim () function: Remove the space left and right. Syntax: Trim (String) arguments: string is any valid string expression. EXAMPLE: <% strTrtest = "this is a test !!" Response.write Trtem (strtest)%> Result: this is a test !!
Ubound () Function: Returns the maximum available subscript of the specified array dimension. Syntax: ubound (arrayname [, dimension]) arguments:; Dimension (optional) Specifies which one dimension of the upper boundary. 1 Represents the first dimension, 2 means a second dimension, and so on. If the Dimension parameter is omitted, the default value is 1. EXAMPLE: <% i = array ("Monday", "Tuesday", "Wednesday") Response.write Ubound (i)%> Result: 2
UCase () Function: Returns the upper business of the string. Syntax: ucase (string) arguments: example: <% strTrtest = "this is a test !!" response.write ucase (strTrtest)%> Result: this is a test! !
VARTYPE () Function: Returns the value of the variable quantum type Syntax: Vartype (varName) arguments: example: <% i = 3 response.write Vartype (i)%> Result: 2 (Digital) See "ASP constant"
Weekday () Function: Returns in the first few days. Syntax: weekday (Date [, firstdayofweek]) arguments:. EXample: <% d = # 8/4/99 # response.write weekday (D)%> Result: 4 (Wednesday)
WeekdayName () Function: Returns the name of the first day. Syntax: weekdayName (Weekday [, ABB [, Firstday Fweek]] Arguments: ABB is optional. Boolean value indicates whether abbreviation represents the name of the day of the week. If omitted, the default value is false, that is, the name of the week. Result: Wednesday