asp常用函数
Array()
CInt()
CreateObject()
CStr()
Date()
DateAdd()
DateDiff()
Day()
FormatCurrency()
FormatNumber()
FormatPercent()
Hour()
Instr()
InstrRev()
Int()
IsArray()
IsDate()
IsEmpty()
IsNull()
IsNumeric()
IsObject()
LBound()
LCase()
Left()
Len()
LTrim()
Mid()
Minute()
Month()
MonthName()
Now()
Replace()
Right()
Rnd()
Round()
Rtrim()
Second()
StrReverse()
Time()
Trim()
UBound()
UCase()
VarType()
WeekDay()
WeekDayName()
Year()
_______________________________________________________________________________
_______________________________________________________________________________
_______________________________________________________________________________
Array()
FUNCTION: 返回一个数组
SYNTAX: Array(list)
ARGUMENTS: 字符,数字均可
EXAMPLE: <%
Dim myArray()
For i = 1 to 7
Redim Preserve myArray(i)
myArray(i) = WeekdayName(i)
Next
%>
RESULT: 建立了一个包含7个元素的数组myArray
myArray("Sunday","Monday", ... ... "Saturday")
_______________________________________________________________________________
CInt()
FUNCTION: 将一个表达式转化为数字类型
SYNTAX: CInt(expression)
ARGUMENTS: 任何有效的字符均可
EXAMPLE: <%
f = "234"
response.write cINT(f) + 2
%>
RESULT: 236
转化字符"234"为数字"234",如果字符串为空,则返回0值
_______________________________________________________________________________
CreateObject()
FUNCTION: 建立和返回一个已注册的ACTIVEX组件的实例。
SYNTAX: CreateObject(objName)
ARGUMENTS: objName 是任何一个有效、已注册的ACTIVEX组件的名字.
EXAMPLE: <%
Set con = Server.CreateObject("ADODB.Connection")
%>
RESULT:
_______________________________________________________________________________
CStr()
FUNCTION: 转化一个表达式为字符串.
SYNTAX: CStr(expression)
ARGUMENTS: expression 是任何有效的表达式。
EXAMPLE: <%
s = 3 + 2
response.write "The result is: " & cStr(s)
%>
RESULT: 转化数字“5”为字符“5”。
_______________________________________________________________________________
Date()
FUNCTION: 返回当前系统日期.
SYNTAX: Date()
ARGUMENTS: None.
EXAMPLE: <%=Date%>
RESULT: 8/4/99
_______________________________________________________________________________
DateAdd()
FUNCTION: 返回一个被改变了的日期。
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
%>
