Function description in ASP

xiaoxiao2021-03-06  106

Array ()  Function:  Return to a 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 number of arrays containing 7 elements MyArraymyArray ("Sunday", "Monday", ... "SATURDAY"  Cint ()  Function:  Translate an expression into a digital type  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 the string is empty, return 0 value createObject ()  function :  Establish and return an instance of a registered ActiveX component.  Syntax: createObject (objName)  arguments: objName is the name of any valid, registered ActiveX component.  EXAMPLE:  <% set con = Server.createObject ("AdoDb.Connection")%>  Result:   cstr ()  Function:  Transformation an expression is a string.  Syntax: cstr (expression)  arguments: EXpression is any valid expression.  EXAMPLE:  <% s = 3 2RESPONSE.WRITE "The result is:" & cstr (s)%>  Result:  Transformation number "5" is character "5".  Date ()  Function:  Return 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/993: 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 [, Firstweekofwear]]  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:  From 8/4/99 to 2000, there are still 150 days.  Day ()  function:  Return to a month of the first day  Syntax: day (date)  arguments: date is any valid date.   EXAMPLE:  <% = day (# 8/4/99 #)%>  Result: 4  Formatcurrency ()  Function:  Return expression, this expression is formatted as a currency Value Syntax: formatcurrency (expression [, Digit [, LeadingDigit [, Paren [, GroupDigit]]])  arguments:  Digit Indicates the value of the number of digits on the right side of the decimal point. 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  Formator ()  Function:  Return expression, this expression is formatted as date or time  Syntax: FormatorDateTime (Date, [, NamedFormat])  arguments: namedFormat Indicates the value of the date / time format used, if omitted, use vbGeneralDate. Example:  <% = formtdatetime ("08/4/99 ", vblongdate)%>  Result: wednesday, August 04, 1999 FormatNumber ()  Function:  Return expression, this expression has been formatted to values.  Syntax: formatNumber (Expression [, DIGIT [, LeadingDigit]]]]]  arguments:  DIGIT 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. 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.325  Formatpercent ()  Function:  Return expression, this expression has been formatted as a percentage Percentage (multiplied by 100). (%)  SYNTAX: FormatPercent (Expression [, Digit [, LeadingDigit [, Paren [, GroupDigit]]]])  ARGUMENTS:  above . EXAMPLE:  <% = FormatPercent (0.45267, 3)% >    45.267%   HOUR ()  function:  Return to the hours in 24.  Syntax: HOUR (TIME)  arguments:   EXAMPLE:  <% = HOUR (# 4:45:34 PM #)%>  Result: 16 (HOUR HASTEM)  instr ()  Function:  Return to character or string in another string The location of the appearance.  Syntax: instr ([Start,] Strtobesearched, StrsearchFor [, Compare])  arguments: Start for the starting value of the search, STRTOBESEARCHED accepts the search character string STRSEARCHFOR to search the characters .Compare comparison method (detailed view ASP constant)  EXAMPLE:  <% strText = "this is a test !!" POS = Instr (Strtext, "A") Response.write POS%>  Result: 9  instrrev ()  Function:  , just from the last search of the string, Syntax: instrrev ([Start,] strStrrearched, strSearchfor [, compare])  arguments:  .  EXAMPLE :  <% strText = "this is a test !!" POS = ISTRREV (Strtext, "S") Response.write POS%>  Result: 13

 int ()  function:  Return to numerical type, not surrounded by.  Syntax: int (Number)  arguments:   EXAMPLE:  <% = int (32.89)%>  Result: 32 isarray ()  function:  Judgment an object is an array Return to Boolean: isarray (name)  arguments:   EXAMPLE:  <% strate = "test!" Response.write isarray (strTest)%>  Result: false   Isdate ()  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 (strTRTEST)%>  Result: true  isempty ()  function:    一 初 初, return to Boolean value.  Syntax: isempty (expression)   arguments:   EXAMPLE:  <% DIM IRESPONSE.WRITE ISEMPTY (i)%>  Result: true  isnull ()  function:  Judgment is empty, return to Boolean value. Syntax: ISNULL (Expression)  arguments:   EXAMPLE:  <% DIM IRESPONSE.WRITE ISNULL (i)%>  Result: false  isnumeric ()  Function:  Judgment is an object is Digital, return to Boolean value.  Syntax: isnumeric (expression)  arguments:   EXAMPLE:  <% i = "345" Response.write isnumeric (i)%>  Result: true Even if the number is added Quotation marks, ASP still think it is a number.  ISObject ()  function:  Judgment whether an object is an object, return to Boolean value.  Syntax: isobject (expression)  arguments:   EXAMPLE:  <% set con = Server.createObject (" Adodb.connection ") Response.write isobject (con)%>  Result: true  lbound ()  function:  Return to the minimum available subscript of the specified number set.  Syntax: lbound (arrayname , Dimension])  arguments: ; DIMENSION indicates which one of the minimalines to return. 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:  Return strings Small-write form  Syntax: lcase (String)  arguments: String is any value:  <% strTrtest = "this is a Test! "Response.write Lcase (strTest)%>  Result: this is a test! left ()  Function:  Return to the top of the string (including Changth characters) ).  SYNTAX: left (string, length)  arguments:   EXAMPLE:  <% strate = "this is a test!" Response.write Left (strTest, 3)%>  Result: thi  len ()  Function:  Return the length of the string.  Syntax: len (String | Varname)  arguments:   EXAMPLE:  <% strate = "this is a test!" Response. Write len (strTest)%>  Result: 15  ltrim ()  function:   掉 左 空 空 :  arguments:   EXAMPLE:  < % strTest = "this is a test!" Response.write Ltrim (STRTEST)%>  Result: this is a test!  MID ()  function:  Returns a specific length string (starting from Start) Length Length).  Syntax: MID (String, Start [, Length])  arguments:   EXAMPLE:  <% strTest = "this is a test! T Oday 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 value:  <% = 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:  ugust now ()  function: returns the current system date and time. Syntax: NOW ()  arguments: none  EXAMPLE:  < % = Now%>  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. eXAMPL E:  <% strate = "this is an apple!" Response.write replace (Strtest, "Apple", "Orange")%>  Result: this is an an orange!  right ()  Function :  Return to the character (including Changth characters) before the string (including Changth characters).  Syntax: right (string, length)  arguments: .  EXAMPLE:  <% strtest = "this is AN Test! "Response.write Right (strTest, 3)%>  RESULT: st! rnd ()  function:  Produce a random number.  Syntax: rnd [(Number)]   arguments:   EXAMPLE:  <% randomize () Response.write rnd ()%>  Result:   Round ()  Function:  Return Press specified The number of digits is rounded.  Syntax: Round (Expression [, nuMright])  arguments: numright number indicates how many counts of decimal points are rounded.

If omitted, the ROUND function returns an integer.  EXAMPLE:  <% i = 32.45678Response.write runk (i)%>  Result: 32 rtrim ()  Function:    字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:  排 一 一  Syntax: strreverse (String)  arguments:   EXAMPLE:  <% strTrtest = "this is a test !! "response.write strreverse (strTest)%>  Result:  !! tset a si sihttime ()  function:  Return to the system time.  Syntax: time ()  Arguments: . .  EXAMPLE:  <% = Time%>  Result:  9: 58: 28 AM TRIM ()  function:     字.  Syntax: trim (String)  Arguments: String is any value:  <% strate = "this is a test !!" response.write trim (strtest)%>  Result: this is a test !!  ubound ()  function:  Return to the maximum available subscript of the specified array dimension.  Syntax: ubound (arrayname [, dimension])  arguments: ; DIMENSION (optional) Specify how One Motion integers. 1 Represents the first dimension, 2 means a second dimension, and so on.

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

New Post(0)