ASP common function description (original, finishing)

xiaoxiao2021-03-06  105

Array () function description: Returns a array grammatical format: array (list) Parameter Description: Character, digital codes: DIM User = Array ("Zhang San", "Li Si", "Wang 5") Returns: Established an array containing 3 elements

CINT () function description: Translate an expression into a digital type syntax format: CINT (Expression) Parameter Description: Any valid character can code example: CINT (236.42) Returns: 236 (Return if the string is empty 0 value)

CreateObject () Function Description: Establish and return an instance of a registered ActiveX component. Grammatical format: createObject (objName) Parameter Description: ObjName is the name of any valid, registered ActiveX component. Code example: set conn = server.createObject ("adodb.connection") Returns: None

CSTR () function Description: Transform an expression as a string. Syntax format: cstr (expression) Parameter Description: Expression is any valid expression. Code Sample: Response.write CSTR (123) Returns: "123"

Date () function description: Return the current system date. Syntax format: Date () Parameter Description: No code Example: Date () Return Results: 2004-09-14

DATEADD () function Description: Returns a changed date. Syntax format: dateadd (TimeInterval, Number, Date) Parameter Description: TimeInterval is the time interval type to increase, such as "Y", "M", "D", "H", etc .; Number is the time interval to increase Quantity; DATE is the time increased reference time. Code example: DataAdd ("M", 1, CDATE ("2004-09-14 17:12:23")) Return Results: 2004-10-14 17:12:23 There is a trick here (for beginners), if Number is negative, it is equivalent to subtracting the ABS (Number) time interval.

Datediff () function description: Returns the difference between the two dates. Syntax format: DateDiff (TimeInterval, Date1, Date2 [, FirstDayofweek [, Firstweekofweear >>) Parameter Description: TimeInterval indicates the type of the separation time, such as "M" means "month". Code example: Datediff ("D", "2000-1-1", "1999-8-4") Returns: 150 days from 1999-8-4 to 2000.

Day () function description: Return to a month. Syntax format: DAY (date) Parameter Description: Date is any valid date. Code Example: Day (CDATE ("2004-09-14")) Returns: 14

FormatCurrency () function Description: Return expression, this expression is formatted as a currency value grammatical format: FormatCurrency (Expression [, Digit [, LeadingDigit [, Paren [, GroupDigit >>>>) Parameter Description: Digit Indicates Decimal Point Right The value of the number of digits is displayed. 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. Code Example: Return Result: $ 34.35

FormatDateTime () function description: Return expression, this expression is formatted as a date or time syntax format: formatDateTime (Date, [, nameDFormat>) Description: NamedFormat indicates the value of the date / time format used, if omitted , Use vbGeneraldate. Code Example: Return Result: Wednesday, August 04, 1999FormatNumber () function Description: Return Expression, this expression has been formatted to a value. Syntax format: formatNumber (Expression [, Digit [, LeadingDigit [, PAREN [YOUPDIGIT >>>>) Parameter Description: Digit Indicates the value of the number of display bits on the right side of the decimal point. 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. . Code example: Return Results: 45.325

Formatpercent () function Description: Returns the expression, this expression has been formatted as a percentage of the percentage of the tail (multiplying 100). (%) Syntax format: formatpercent (Expression [, Digit [, LeadingDigit [, PAREN [, GroupDigit >>>>) Parameter Description: Same up. Code example: Return Result: 45.267%

Hour () function description: Return to the hour in 24. Syntax format: hour (time) Parameter Description: Code Sample: Return Result: 16 (Hour Has Been Converted To 24-Hour System)

INSTR () function description: Returns the first place in another string in another string. Syntax format: Instr ([Start,> Strtobesearched, StRSEARCHFOR [, Compare>) Parameter Description: Start is the start of search Value, Strtobesearched Accepts Strings STRSEARCHFOR To search for Character Compare Compare Method (Details ASP Constant) Code Sample: Instr (1, "AbcdefgabcDefg", "BC") Return Result: 2

Instrrev () function description: I have the last search from the string to syntax format: INSTRREV ([Start,> Strtobesear) Parameter Description: Same as the same. Code example: Instrrev (1, "abcdefgabcdefg", "BC") return results: 9

INT () function description: Returns the numeric type, not rounded. Syntax format: int (expression) Parameter Description: Expression is an arbitrary legitimate expression. Code Example: Return Result: 32

Isarray () function description: Determine if an object is an array, return to the Boolean value. Syntax format: Isarray (Expression) Parameter Description: Expression code example: Return Result: True / False

Isdate () function description: Determine if an object is a date, return to Boolean grammar format: Isdate (Expression) Parameter Description: Expression is an arbitrary legitimate expression. Code Example: Isdate ("ABC") Returns: falseisempty () function Description: Determine whether an object is initialized, return to the Boolean value. Syntax format: ISempty (Expression) Parameter Description: Expression is an arbitrary legal expression. Code Example: Return Result: True / False

ISNULL () function description: Determine whether an object is empty, return to the Boolean value. Syntax format: isnull (Expression) Parameter Description: Expression is an arbitrary legal expression. Code Example: Return Result: True / false isnumeric () function Description: Determine if an object is a number, return to the Boolean value. Syntax format: ISNUMERIC (Expression) Parameter Description: Expression is an arbitrary legitimate expression. Code Sample: Return Result: True / False Even if the number adds quotation marks, ASP still thinks it is a number.

IsObject () function description: Determine if an object is an object, return to the Boolean value. Syntax format: IsObject (expression) Parameter Description: Expression is an arbitrary legal expression. Code Example: Return Result: True / False

LBound () function description: Returns the minimum available subscript of the specified array dimension. Syntax format: lbound (ArrayName [, Dimension>) Parameter Description: Dimension indicates which one of the weighing boundaries to returns. Use 1 to represent the first dimension, 2 represents the second dimension, and so on. If the Dimension parameter is omitted, the default value is 1. Code: Return the result:

LCASE () function description: Returns the lowercase format format of the string: LCASE (String) Parameter Description: String is an arbitrary legitimate expression. Code example: Lcase ("this is a test!") Returns: this is a test!

LEFT () function description: Returns the previous character (including ZENGTH character) on the left side of the string. Syntax format: Left (string, length) Parameter Description: String is the original string, Length is the character to be obtained. number. Code Example: Left ("Left", 3) Returns: LEF

LEN () function description: Returns the length of the string. Syntax format: Len (String | VarName) Parameter Description: String is an arbitrary legal expression. Code Example: Return Result: 15

LTRIM () function description: Remove the space left on the left. Syntax format: Ltrim (String) Parameter Description: String is a string code example: Ltrim ("this is a test!") Returns: "this is a test!"

MID () function Description: Returns a specific length string (starting from START, length length). Syntax format: MID (String, Start [, Length>) Parameter Description: String is the original string, start is a location that started LENGTH is an intercepted string length code: MID ("AbcDefg", 2, 3) Returns: BCD If you omit, you will omit Length, then intercept all characters from the Start position to the end.

Minute () function description: Return time minutes. Syntax format: Minute (TIME) Parameter Description: Time is an arbitrary legal date expression. Code Sample: Minute ("2004-09-14 17:12:23") Returns: 14MONTH () function Description: Return Month. Syntax Format: Month (Date) Parameter Description: Date is an arbitrary legal date expression. Code Example: Month ("2004-09-14 17:12:23") Return Result: 9

MONTHNAME () function Description: Returns a string for identifying specific months in the local system format. Syntax format: MONTHNAME (MONTH, [, ABB>) Parameter Description: Month is a given month representation; ABB (optional) Is a logical value for controlling whether the month abbreviation is displayed .True means that the month abbreviation is displayed, and False is not displayed. Code example: MONTHNAME ("2004-09-14 17:12:23") Return Result: September

Now () function description: returns the current system date and time. Syntax format: now () parameter description: No code example: now () Return Results: 2004-09-14 17:12:23 This is my time, you When the call is called, it should be your time.

Replace () function Description: Returns a string string strs in string STRTOBESEARCHED to replace the string after the COUNT after another string StrReplaceWith. . Syntax format: Replace (Strtobesearched, StRSearchfor, Strreplacewith "parameter description: Strtobesearched is a string that is replaced; strSearchfor is the sub-string to find in Strtobesearched; StrRreplace is Replace the string; start (optional) is the location where the search is started; COUNT (optional) is the number of times to replace, and all replace it is omitted. Code Example: Replace ("this is an apple!", "Apple", "orange") Returns: this is an iora!

Right () function description: Returns the character (including Changth characters) before the first side of the string. Syntax format: Right (string, length) Parameter Description: String is the original string, Length is the character to be intercepted number. Code Example: Right ("Right", 3) Returns: GHT

RND () function description: Generate a random number. Syntax format: RND [(Number)> Parameter Description: Code Example: Return Result: Number of Number of 0 to 1

Round () function description: Return to the value of the number of positions to be rounded. Syntax format: Round (Expression [, nuMright>) Parameter Description: Numright number indicates how many counts in the right side of the decimal point. If omitted, the Round function returns an integer. Code example: Round (1234.567, 2) Error Return Results: 1234.570 (Note: Thanks Yippee Tips, due to my negligence, it is also the effect of SQL Server, there is this error result, at the same time Here, everyone, the SQL Server query analyzer's Round will result in this result: 1234.57rtrim () function Description: Remove the string on the right side of the string. Syntax format: RTRIM (String) Parameter Description: Code Example: RTIM ("This is a test!") Returns: "this is a test!"

Second () function description: Return second. Syntax format: Second (Expression) Parameter Description: Expression is an arbitrary legitimate time expression. Code Example: MONTHNAME ("2004-09-14 17:12:23") Returns: 23

Strreverse () function description: Reverse row character string syntax format: strreverse (string) Parameter Description: Code example: strreverse ("this is a test!") Returns: "! Tset a si siht"

Time () function description: Return to system time. Syntax format: Time () Parameter Description:. Code Sample: Time () Return Results: 17:12:23

Trim () function description: Remove the space left and right. Syntax format: Trim (String) Parameter Description: String is an arbitrary legal string expression. Code Example: Trim ("this is a test!") Returns: "this is a test!"

Ubound () function description: Returns the maximum available subscript of the specified array dimension. Syntax format: Ubound (ArrayName [, Dimension>) Parameter Description: Dimension (optional) Specifies which one-dimensional upper boundary integer. 1 Represents the first dimension, 2 means a second dimension, and so on. If the Dimension parameter is omitted, the default is 1. Code: Return Result: 2

UCASE () function description: Returns the uppercase of the string. Syntax format: ucase (string) Parameter Description: Code Sample: ucase ("this is a test!") Returns: this is a test!

VARTYPE () function description: Returns the value syntax format indicating the variable quantum type: VARTYPE (VARNAME) Parameter Description: VarName is any expressed expression code example: Return Result: 2 (Digital)

Weekday () function description: Return to the first few days of one week. Syntax format: Weekday (Date [, firstdayofweek>) Parameter Description: Date is an arbitrary legal time expression code code: Weekday ("2004-09-14 17:12 : 23 ") Return Result: 3 (Tuesday) Pay attention to foreigners' habits, on Sunday, is both 1, Monday, is both 2, according to such push

WeekdayName () function description: Return the first week of the day. Syntax format: WeekDayName (Date [, ABB [, Firstday) Parameter Description: Date is an arbitrary legal time expression, ABB (optional) Boolean value, Indicates whether abbreviations indicate the names of the days in the week. If omitted, the default value is false, that is, the name of the week. The name of the day is not allowed. Function Description: Returns the current year. Syntax format: Year (date) Parameter Description: Date is an arbitrary legal time expression. Code Example: Year ("2004-09-14 17:12:23") Return Result: 2004

转载请注明原文地址:https://www.9cbs.com/read-124470.html

New Post(0)