level 1
刀锋意志w
楼主
求解释的详细点。每行代码的作用,谢啦
<%
function Num_clng(charstr,defaultnum)
if charstr="" then
charstr=clng(defaultnum)
elseif isnumeric(charstr) then
charstr=clng(charstr)
else
charstr=clng(defaultnum)
end if
Num_clng=charstr
end function
%>
<%
Function cutStr(str,strlen)
Dim l,t,c,i
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
cutStr=left(str,i)
Exit For
Else
cutStr=str
End If
Next
End Function
Function RemoveHTML(strHTML)
strHTML=replace(strHTML," "," ")
Dim objRegExp, Match, Matches
Set objRegExp = New Regexp
objRegExp.IgnoreCase = True
objRegExp.Global = True
objRegExp.Pattern = "<.+?>"
Set Matches = objRegExp.Execute(strHTML)
For Each Match in Matches
strHtml=Replace(strHTML,Match.Value,"")
Next
RemoveHTML=strHTML
Set objRegExp = Nothing
End Function
%>
2014年03月29日 09点03分
1
<%
function Num_clng(charstr,defaultnum)
if charstr="" then
charstr=clng(defaultnum)
elseif isnumeric(charstr) then
charstr=clng(charstr)
else
charstr=clng(defaultnum)
end if
Num_clng=charstr
end function
%>
<%
Function cutStr(str,strlen)
Dim l,t,c,i
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
cutStr=left(str,i)
Exit For
Else
cutStr=str
End If
Next
End Function
Function RemoveHTML(strHTML)
strHTML=replace(strHTML," "," ")
Dim objRegExp, Match, Matches
Set objRegExp = New Regexp
objRegExp.IgnoreCase = True
objRegExp.Global = True
objRegExp.Pattern = "<.+?>"
Set Matches = objRegExp.Execute(strHTML)
For Each Match in Matches
strHtml=Replace(strHTML,Match.Value,"")
Next
RemoveHTML=strHTML
Set objRegExp = Nothing
End Function
%>