欢迎来到冰点文库! | 帮助中心 分享价值,成长自我!
冰点文库
全部分类
  • 临时分类>
  • IT计算机>
  • 经管营销>
  • 医药卫生>
  • 自然科学>
  • 农林牧渔>
  • 人文社科>
  • 工程科技>
  • PPT模板>
  • 求职职场>
  • 解决方案>
  • 总结汇报>
  • ImageVerifierCode 换一换
    首页 冰点文库 > 资源分类 > DOCX文档下载
    分享到微信 分享到微博 分享到QQ空间

    asp函数大全.docx

    • 资源ID:4163544       资源大小:18.23KB        全文页数:13页
    • 资源格式: DOCX        下载积分:3金币
    快捷下载 游客一键下载
    账号登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录 QQ登录
    二维码
    微信扫一扫登录
    下载资源需要3金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝    微信支付   
    验证码:   换一换

    加入VIP,免费下载
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    asp函数大全.docx

    1、asp函数大全ASP的函数详解Array()FUNCTION: 返回一个数组SYNTAX: Array(list)ARGUMENTS: 字符,数字均可EXAMPLE: %Dim myArray()For i = 1 to 7Redim Preserve myArray(i)myArray(i) = WeekdayName(i)Next%/IMGRESULT: 建立了一个包含7个元素的数组myArraymyArray(Sunday,Monday, . . Saturday)CInt()FUNCTION: 将一个表达式转化为数字类型SYNTAX: CInt(expression)ARGUMENTS

    2、: 任何有效的字符均可EXAMPLE: %f = 234response.write cINT(f) + 2%/IMGRESULT: 236转化字符234为数字234,如果字符串为空,则返回0值CreateObject()FUNCTION: 建立和返回一个已注册的ACTIVEX组件的实例。SYNTAX: CreateObject(objName)ARGUMENTS: objName 是任何一个有效、已注册的ACTIVEX组件的名字.EXAMPLE: %Set con = Server.CreateObject(ADODB.Connection)%/IMGRESULT:CStr()FUNCTIO

    3、N: 转化一个表达式为字符串.SYNTAX: CStr(expression)ARGUMENTS: expression 是任何有效的表达式。EXAMPLE: %s = 3 + 2response.write The result is: & cStr(s)%/IMGRESULT: 转化数字“5”为字符“5”。Date()FUNCTION: 返回当前系统日期.SYNTAX: Date()ARGUMENTS: None.EXAMPLE: %=Date%/IMGRESULT: 8/4/99DateAdd()FUNCTION: 返回一个被改变了的日期。SYNTAX: DateAdd(timeinte

    4、rval,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%/IMG%currentDate = #12:34:45 PM#newDate = DateAdd(h,3,currentDate)re

    5、sponse.write newDate%/IMGRESULT: 11/4/993:34:45 PMm = month;d = day;If currentDate is in time format then,h = hour;s = second;DateDiff()FUNCTION: 返回两个日期之间的差值 。SYNTAX: DateDiff(timeinterval,date1,date2 , firstdayofweek , firstweekofyear/IMG/IMG)ARGUMENTS: timeinterval 表示相隔时间的类型,如“M“表示“月”。EXAMPLE: %fr

    6、omDate = #8/4/99#toDate = #1/1/2000#response.write There are & _DateDiff(d,fromDate,toDate) & _ days to millenium from 8/4/99.%/IMGRESULT: 从8/4/99 到2000年还有 150 天.Day()FUNCTION: 返回一个月的第几日 .SYNTAX: Day(date)ARGUMENTS: date 是任何有效的日期。EXAMPLE: %=Day(#8/4/99#)%/IMGRESULT: 4FormatCurrency()FUNCTION: 返回表达式,

    7、此表达式已被格式化为货币值SYNTAX: FormatCurrency(Expression , Digit , LeadingDigit , Paren , GroupDigit/IMG/IMG/IMG/IMG)ARGUMENTS: Digit 指示小数点右侧显示位数的数值。默认值为 -1,指示使用的是计算机的区域设置; LeadingDigit 三态常数,指示是否显示小数值小数点前面的零。EXAMPLE: %=FormatCurrency(34.3456)%/IMGRESULT: $34.35FormatDateTime()FUNCTION: 返回表达式,此表达式已被格式化为日期或时间SY

    8、NTAX: FormatDateTime(Date, , NamedFormat/IMG)ARGUMENTS: NamedFormat 指示所使用的日期/时间格式的数值,如果省略,则使用 vbGeneralDate.EXAMPLE: %=FormatDateTime(08/4/99, vbLongDate)%/IMGRESULT: Wednesday, August 04, 1999FormatNumber()FUNCTION: 返回表达式,此表达式已被格式化为数值.SYNTAX: FormatNumber(Expression , Digit , LeadingDigit , Paren ,

    9、 GroupDigit/IMG/IMG/IMG/IMG)ARGUMENTS: Digit 指示小数点右侧显示位数的数值。默认值为 -1,指示使用的是计算机的区域设置。; LeadingDigit i指示小数点右侧显示位数的数值。默认值为 -1,指示使用的是计算机的区域设置。; Paren 指示小数点右侧显示位数的数值。默认值为 -1,指示使用的是计算机的区域设置。; GroupDigit i指示小数点右侧显示位数的数值。默认值为 -1,指示使用的是计算机的区域设置。.EXAMPLE: %=FormatNumber(45.324567, 3)%/IMGRESULT: 45.325FormatPe

    10、rcent()FUNCTION: 返回表达式,此表达式已被格式化为尾随有 % 符号的百分比(乘以 100 )。 (%)SYNTAX: FormatPercent(Expression , Digit , LeadingDigit , Paren , GroupDigit/IMG/IMG/IMG/IMG)ARGUMENTS: 同上.EXAMPLE: %=FormatPercent(0.45267, 3)%/IMGRESULT: 45.267%Hour()FUNCTION: 以24时返回小时数.SYNTAX: Hour(time)ARGUMENTS:EXAMPLE: %=Hour(#4:45:34

    11、 PM#)%/IMGRESULT: 16(Hour has been converted to 24-hour system)Instr()FUNCTION: 返回字符或字符串在另一个字符串中第一次出现的位置.SYNTAX: Instr(start, /IMG strToBeSearched, strSearchFor , compare/IMG)ARGUMENTS: Start为搜索的起始值,strToBeSearched接受搜索的字符串 strSearchFor要搜索的字符compare 比较方式(详细见ASP常数)EXAMPLE: %strText = This is a test!po

    12、s = Instr(strText, a)response.write pos%/IMGRESULT: 9InstrRev()FUNCTION: 同上,只是从字符串的最后一个搜索起SYNTAX: InstrRev(start, /IMG strToBeSearched, strSearchFor , compare/IMG)ARGUMENTS: 同上.EXAMPLE: %strText = This is a test!pos = InstrRev(strText, s)response.write pos%/IMGRESULT: 13Int()FUNCTION: 返回数值类型,不四舍五入。S

    13、YNTAX: Int(number)ARGUMENTS:EXAMPLE: %=INT(32.89)%/IMGRESULT: 32IsArray()FUNCTION: 判断一对象是否为数组,返回布尔值 .SYNTAX: IsArray(name)ARGUMENTS:EXAMPLE: %strTest = Test!response.write IsArray(strTest)%/IMGRESULT: FalseIsDate()FUNCTION: 判断一对象是否为日期,返回布尔值SYNTAX: IsDate(expression)ARGUMENTS: expression is any valid

    14、 expression.EXAMPLE: %strTest = 8/4/99response.write IsDate(strTest)%/IMGRESULT: TrueIsEmpty()FUNCTION: 判断一对象是否初始化,返回布尔值.SYNTAX: IsEmpty(expression)ARGUMENTS:EXAMPLE: %Dim iresponse.write IsEmpty(i)%/IMGRESULT: TrueIsNull()FUNCTION: 判断一对象是否为空,返回布尔值.SYNTAX: IsNull(expression)ARGUMENTS:EXAMPLE: %Dim i

    15、response.write IsNull(i)%/IMGRESULT: FalseIsNumeric()FUNCTION: 判断一对象是否为数字,返回布尔值.SYNTAX: IsNumeric(expression)ARGUMENTS:EXAMPLE: %i = 345response.write IsNumeric(i)%/IMGRESULT: True就算数字加了引号,ASP还是认为它是数字。IsObject()FUNCTION: 判断一对象是否为对象,返回布尔值.SYNTAX: IsObject(expression)ARGUMENTS:EXAMPLE: %Set con = Serv

    16、er.CreateObject(ADODB.Connection)response.write IsObject(con)%/IMGRESULT: TrueLBound()FUNCTION: 返回指定数组维的最小可用下标.SYNTAX: Lbound(arrayname , dimension/IMG)ARGUMENTS: dimension 指明要返回哪一维下界的整数。使用 1 表示第一维,2 表示第二维,以此类推。如果省略 dimension 参数,默认值为 1.EXAMPLE: %i = Array(Monday,Tuesday,Wednesday)response.write LBou

    17、nd(i)%/IMGRESULT: 0LCase()FUNCTION: 返回字符串的小写形式SYNTAX: Lcase(string)ARGUMENTS: string is any valid string expression.EXAMPLE: %strTest = This is a test!response.write LCase(strTest)%/IMGRESULT: this is a test!Left()FUNCTION: 返回字符串左边第length个字符以前的字符(含第length个字符).SYNTAX: Left(string, length)ARGUMENTS:EX

    18、AMPLE: %strTest = This is a test!response.write Left(strTest, 3)%/IMGRESULT: ThiLen()FUNCTION: 返回字符串的长度.SYNTAX: Len(string | varName)ARGUMENTS:EXAMPLE: %strTest = This is a test!response.write Len(strTest)%/IMGRESULT: 15LTrim()FUNCTION: 去掉字符串左边的空格.SYNTAX: LTrim(string)ARGUMENTS:EXAMPLE: %strTest = T

    19、his is a test!response.write LTrim(strTest)%/IMGRESULT: This is a test!Mid()FUNCTION: 返回特定长度的字符串(从start开始,长度为length).SYNTAX: Mid(string, start , length/IMG)ARGUMENTS:EXAMPLE: %strTest = This is a test! Today is Monday.response.write Mid(strTest, 17, 5)%/IMGRESULT: TodayMinute()FUNCTION: 返回时间的分钏.SYNT

    20、AX: Minute(time)ARGUMENTS:EXAMPLE: %=Minute(#12:45:32 PM#)%/IMGRESULT: 45Month()FUNCTION: 返回日期.SYNTAX: Month(date)ARGUMENTS: date is any valid date expression.EXAMPLE: %=Month(#08/04/99#)%/IMGRESULT: 8MonthName()FUNCTION: Returns a string identifying the specified month.SYNTAX: MonthName(month, , Ab

    21、b/IMG)ARGUMENTS: month is the numeric representation for a given month; Abb (optional) is a boolean value used to display month abbreviation. True will display the abbreviated month name and False (default) will not show the abbreviation.EXAMPLE: %=MonthName(Month(#08/04/99#)%/IMGRESULT: AugustNow()

    22、FUNCTION: Returns the current system date and time.SYNTAX: Now()ARGUMENTS: NoneEXAMPLE: %=Now%/IMGRESULT: 8/4/99 9:30:16 AMReplace()FUNCTION: Returns a string in which a specified sub-string has been replaced with another substring a specified number of times.SYNTAX: Replace(strToBeSearched, strSear

    23、chFor, strReplaceWith , start , count , compare/IMG/IMG/IMG)ARGUMENTS: strToBeSearched is a string expression containing a sub-string to be replaced; strSearchFor is the string expression to search for within strToBeSearched; strReplaceWith is the string expression to replace sub-string strSearchFor

    24、; start (optional) is the numeric character position to begin search; count (optional) is a value indicating the comparision constant.EXAMPLE: %strTest = This is an apple!response.write Replace(strTest, apple, orange)%/IMGRESULT: This is an orange!Right()FUNCTION: 返回字符串右边第length个字符以前的字符(含第length个字符)

    25、.SYNTAX: Right(string, length)ARGUMENTS: .EXAMPLE: %strTest = This is an test!response.write Right(strTest, 3)%/IMGRESULT: st!Rnd()FUNCTION: 产生一个随机数.SYNTAX: Rnd (number) /IMGARGUMENTS:EXAMPLE: %Randomize()response.write RND()%/IMGRESULT: 任何一个在0 到 1 之间的数Round()FUNCTION: 返回按指定位数进行四舍五入的数值.SYNTAX: Round

    26、(expression , numRight/IMG)ARGUMENTS: numRight数字表明小数点右边有多少位进行四舍五入。如果省略,则 Round 函数返回整数.EXAMPLE: %i = 32.45678response.write Round(i)%/IMGRESULT: 32Rtrim()FUNCTION: 去掉字符串右边的字符串.SYNTAX: Rtrim(string)ARGUMENTS:EXAMPLE: %strTest = This is a test! response.write RTrim(strTest)%/IMGRESULT: This is a test!S

    27、econd()FUNCTION: 返回秒.SYNTAX: Second(time)ARGUMENTS: .EXAMPLE: %=Second(#12:34:28 PM#)%/IMGRESULT: 28StrReverse()FUNCTION: 反排一字符串SYNTAX: StrReverse(string)ARGUMENTS:EXAMPLE: %strTest = This is a test!response.write StrReverse(strTest)%/IMGRESULT: !tset a si sihTTime()FUNCTION: 返回系统时间.SYNTAX: Time()ARGUMENTS: .EXAMPLE: %=Time%/IMGRESULT: 9:58:28 AMTrim()FUNCTION: 去掉字符串左右的空格.SYNTAX: Trim(string)ARGUMENTS: string is any valid string expression.EXAMPLE: %strTest = This is a test!


    注意事项

    本文(asp函数大全.docx)为本站会员主动上传,冰点文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰点文库(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

    copyright@ 2008-2023 冰点文库 网站版权所有

    经营许可证编号:鄂ICP备19020893号-2


    收起
    展开