当前位置:好百科>生活百科>用VBScript编个函数

用VBScript编个函数

2024-09-01 19:37:48 编辑:zane 浏览量:543

用VBScript编个函数

的有关信息介绍如下:

用VBScript编个函数

用这段把,动易公司开发的系统都是用搞的这个,只不是函数名称不同,但是觉得功能一样!'**************************************************'函数名:gotTopic'作 用销局仿:截字符串,汉字一个算两个字符,英文算一个字符'亏纤参 数:str ----原字符串' strlen ----截取长度'返回值:截取后的字符串'**************************************************function gotTopic(str,strlen) if str="" then gotTopic="" exit function end if dim l,t,c, i str=replace(replace(replace(replace(str," "," "),""",chr(34)),">",">"),"<","<") l=len(str) t=0 for i=1 to l c=Abs(Asc(Mid(str,i,1))) if c>255 then t=t+2 else t=t+1 end if if t>=strlen then gotTopic=left(str,i) & "…腊兆" exit for else gotTopic=str end if next gotTopic=replace(replace(replace(replace(gotTopic," "," "),chr(34),"""),">",">"),"<","<")end function

版权声明:文章由 好百科 整理收集,来源于互联网或者用户投稿,如有侵权,请联系我们,我们会立即处理。如转载请保留本文链接:https://www.haobaik.com/life/104527.html
热门文章