function Array ()
function: returns an array
syntax:array (list)
arguments: characters, numbers can be
example:<%
Dim MyArray ()
For i = 1 to 7
redim Preserve myarray (i)
myarray (i) = WeekdayName (i)
Next
%>
result: set up an array containing 7 elements myarray
MyArray ("Sunday", "Monday", ...) "Saturday")
cint ()
function: converts an expression to a numeric type
syntax:cint (expression)
arguments: any valid characters can be
example:<%
F = "234"
Response.Write CINT (f) + 2
%>
result:236
The conversion character "234" is the number "234" and returns a value of 0 if the string is empty
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#
Newdate = DATEADD ("h", 3,currentdate)
Response.Write Newdate
%>
result:11/4/99
3:34:45 PM
"M" = "month";
"D" = "Day";
If currentdate is in the time format then,
"H" = "Hour";
"S" = "second";
datediff ()
function: returns the difference between two dates.
syntax:datediff (Timeinterval,date1,date2 [, FirstDayOfWeek [, FirstWeekOfYear]])
The arguments:timeinterval represents the type of time separated, as "M" means "month."
example:<%
FromDate = #8/4/99#
ToDate = #1/1/2000#
Response.Write "There are" & _
datediff ("D", Fromdate,todate) & _
"Millenium from 8/4/99."
%>
result: is 150 days from 8/4/99 to 2000.
day ()
function: returns the first few days of the one month .
syntax:day (date)
arguments:date is any valid date.
example:<%=day (#8/4/99#)%>
result:4
formatcurrency ()
function: returns an expression that has been formatted as a currency value
syntax:formatcurrency (Expression [, Digit [, Leadingdigit [, Paren [, Groupdigit]]]]
arguments:digit indicates the number of digits displayed to the right of the decimal point. The default value is-1, which indicates that the computer's locale is being used; Leadingdigit a three-state constant that indicates whether to display 0 of the decimal point in the front.
example:<%=formatcurrency (34.3456)%>
result:$34.35
formatdatetime ()
function: returns an expression that has been formatted as a date or time
syntax:formatdatetime (Date, [, NamedFormat])
arguments:namedformat indicates the value of the date/time format used, and if omitted, uses the Vbgeneraldate.
example:<%=formatdatetime ("08/4/99", vbLongDate)%>
result:wednesday, August 04, 1999
formatnumber ()
function: returns an expression that has been formatted as a numeric value.
syntax:formatnumber (Expression [, Digit [, Leadingdigit [, Paren [, Groupdigit]]]]
arguments:digit indicates the number of digits displayed to the right of the decimal point. The default value is-1, which indicates that the computer's locale is being used.; Leadingdigit I indicates the number of digits displayed to the right of the decimal point. The default value is-1, which indicates that the computer's locale is being used.; Paren indicates the number of digits displayed to the right of the decimal point. The default value is-1, which indicates that the computer's locale is being used.; Groupdigit I indicates the number of digits displayed to the right of the decimal point. The default value is-1, which indicates that the computer's locale is being used ...
example:<%=formatnumber (45.324567, 3)%>
result:45.325
formatpercent ()
function: returns an expression that has been formatted as a percentage of the trailing% symbol (multiplied by 100). (%)
syntax:formatpercent (Expression [, Digit [, Leadingdigit [, Paren [, Groupdigit]]]]
arguments: Ibid.
example:<%=formatpercent (0.45267, 3)%>
result:45.267%
hour ()
function: returns the number of hours at 24 o'clock.
syntax:hour (Time)
arguments:
example:<%=hour (#4:45:34 pm#)%>
result:16
(Hour has been converted to 24-hour system)
instr ()
function: returns the position of the first occurrence of a character or string in another string.
syntax:instr ([Start,] strtobesearched, strsearchfor [, compare])
arguments:start is the starting value for the search, Strtobesearched accepts the search string strsearchfor the character to search for. Compare comparison mode (see ASP constants in detail)
example:<%
StrText = "This is a test!!"