Description of functions in ASP

Source: Internet
Author: User
Array ()?


? FUNCTION:? Returns an array?


? SYNTAX:? Array (list)?


? ARGUMENTS: The character, the number can be?


? example:?<%


Dim myarray ()


for i = 1 to 7


? Redim Preserve myarray (i)


? MyArray (i) = WeekdayName (i)


Next


%>?


? Result:? An array containing 7 elements was established myarray


myarray ("Sunday", "Monday", ...) "Saturday")?


?


? CInt ()?


? FUNCTION:? Converts an expression to a numeric type?


? SYNTAX:? CINT (expression)?


? ARGUMENTS:? Any valid characters are available?


? example:?<%


f = "234"


Response.Write CINT (f) + 2


%>?


? result:?236


conversion character "234" is the number "234", if the string is empty, then return 0 values??


?


? 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:?<%


Set con = Server.CreateObject ("ADODB.") Connection ")


%>?


? Result:?


?


? CStr ()?


? FUNCTION:? Converts an expression to a string.?


? SYNTAX:? CSTR (expression)?


? Arguments:?expression is any valid expression.?


? example:?<%


s = 3 + 2


Response.Write "The result is:" & CStr (s)


%>?


? Result:? Converts the number "5" to the character "5".


?


? Date ()?


? FUNCTION:? Returns the current system date.?


? SYNTAX:? Date ()?


? ARGUMENTS:? None.?


? Example:?<%=date%>?


? 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:?<%


currentdate = #8/4/99#


newdate = DateAdd ("M", 3,currentdate)


Response.Write Newdate


%>


<%


currentdate = #12:34:45 pm#


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.