asp实现取得数组中的最大值的代码
更新时间:2007年08月08日 11:30:12 作者:
<%
'******************************
'函数:GetMax(str)
'参数:str,待处理的数字数组,以,分隔多了数字
'作者:阿里西西
'日期:2007/7/12
'描述:取得数组中的最大值
'示例:<%=GetMax("360,120,5,600,32")%>
'******************************
function GetMax(str)
num=split(str,",")
max=num(0)
for ii=0 to ubound(num)
if cint(num(ii))>cint(max) then max=num(ii)
response.write "num="&num(ii)&",max="&max&"<br />"
next
getmax=max
end function
%>
'******************************
'函数:GetMax(str)
'参数:str,待处理的数字数组,以,分隔多了数字
'作者:阿里西西
'日期:2007/7/12
'描述:取得数组中的最大值
'示例:<%=GetMax("360,120,5,600,32")%>
'******************************
function GetMax(str)
num=split(str,",")
max=num(0)
for ii=0 to ubound(num)
if cint(num(ii))>cint(max) then max=num(ii)
response.write "num="&num(ii)&",max="&max&"<br />"
next
getmax=max
end function
%>
相关文章
PJ-Blog教程┊增强博客用户体验~让发表内容的同时拷贝到剪贴板以防丢失
PJ-Blog教程┊增强博客用户体验~让发表内容的同时拷贝到剪贴板以防丢失...2007-01-01
[转]ASP实现关键词获取(各搜索引擎,GB2312及UTF-8)
[转]ASP实现关键词获取(各搜索引擎,GB2312及UTF-8)...2007-02-02


最新评论