ASP Set of functions

Source: Internet
Author: User
Tags time interval valid
1. function Array ()
Function: Create an array variable
Format: Array (list)
Parameters: List of each numeric column in an array variable, separated by a comma
Example:
<% i = Array ("1", "2", "3")%>
Result: I was given an array
2. function CInt ()
Function: Converts an expression/other type of variable to an integer type (int)
Format: Cint (expression)
Parameter: expression is any valid expression/other type of variable
Example:
<%
F = "234"
Response.Write CINT (f) + 2
%>
Results: 236
function CInt () converts the character "234" to an integer 234. If the expression is empty or invalid, the return value is 0;
3. Function: Creatobject ()
Function: Creates and returns an ActiveX object.
Format: Creatobject (obname)
Parameter bname is the name of the object
Example:
<%
Set con = Server.CreateObject ("ADODB.") Connection ")
%>
Results:
4. Function CStr ()
Function: Converts an expression/other type of variable to a character type (string)
Format: Cstr (expression)
Parameter: expression is any valid expression/other type of variable
Example:
<%
s = 3 + 2
Response.Write "The result is:" & CStr (s)
%>
Result: the function CStr () converts the integer 5 to the character "5".
5. Function Date ()
Function: Returns the date of the current system (server side)
Format: Date ()
Parameters: None
Example <% date ()%>
Result: 05/10/00
6. function DateAdd ()
Function: Calculates a specified time and
Format: DateAdd (timeinterval,number,date)
Parameters: TimeInterval is the time unit (month, day ...); Number is the time interval value, date is the point of origin.
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
%>
Results:
11/4/99
3:34:45 PM
which
"M" = "month";
"D" = "Day";
If the format is currentdate, the
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.