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 %> <% 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 time format then, "h" = "hour"; "s" = "second"; DateDiff() FUNCTION: 返回两个日期之间的差值 。 SYNTAX: DateDiff(timeinterval,date1,date2 [, firstdayofweek ][, firstweekofyear]]) ARGUMENTS: timeinterval 表示相隔时间的类型,如“M“表示“月”。 EXAMPLE: <% fromDate = #8/4/99# toDate = #1/1/2000# response.write "There are " & _ DateDiff("d",fromDate,toDate) & _ " days to millenium from 8/4/99." %> RESULT: 从8/4/99 到2000年还有 150 天. Day() FUNCTION: 返回一个月的第几日 . SYNTAX: Day(date) ARGUMENTS: date 是任何有效的日期。 EXAMPLE: <%=Day(#8/4/99#)%> RESULT: 4 FormatCurrency() FUNCTION: 返回表达式,此表达式已被格式化为货币值 SYNTAX: FormatCurrency(Expression [, Digit ][, LeadingDigit ][, Paren ][, GroupDigit]]]]) ARGUMENTS: Digit 指示小数点右侧显示位数的数值。默认值为 -1,指示使用的是
复制本页网址和标题,发送给你QQ/Msn的好友一起分享
上一篇:无组件上传图片到数据库中,最完整解决方案
下一篇:用Flash技术打造超酷的网页右键菜单