asp取得數(shù)組中的最大值的方法
更新時間:2007年11月14日 14:23:54 作者:
如何取得數(shù)組中的最大值(由71port_80端口提供)
該函數(shù)的作用是取得一組數(shù)組中最大的一個值,非常實用且精典,值得收藏!
snum="345,231,56,786,1100,356,1200,300,685,111,134,765"
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
response.Write "數(shù)組"&snum&"<br />最大值:"&GetMax(snum)
該函數(shù)的作用是取得一組數(shù)組中最大的一個值,非常實用且精典,值得收藏!
復(fù)制代碼 代碼如下:
snum="345,231,56,786,1100,356,1200,300,685,111,134,765"
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
response.Write "數(shù)組"&snum&"<br />最大值:"&GetMax(snum)
您可能感興趣的文章:
- asp下使用數(shù)組存放數(shù)據(jù)的代碼
- asp 得到動態(tài)數(shù)組中元素的個數(shù)
- asp.net 數(shù)組中字符串替換的幾種方式
- asp 動態(tài)數(shù)組 提供Add、Insert、Remove、RemoveAt、Search等方法。
- asp.net 字符串、二進制、編碼數(shù)組轉(zhuǎn)換函數(shù)
- asp.net通過js實現(xiàn)Cookie創(chuàng)建以及清除Cookie數(shù)組的代碼
- asp textarea 多行數(shù)組分割處理方法
- asp 數(shù)組 重復(fù)刪除函數(shù)(腳本之家增強版)
- ASP 過濾數(shù)組重復(fù)數(shù)據(jù)函數(shù)(加強版)
- ASP 使用Filter函數(shù)來檢索數(shù)組的實現(xiàn)代碼
- asp數(shù)組的使用介紹
- Asp與JS的數(shù)組和字符串下標(biāo)介紹
- asp中使用redim、preserve創(chuàng)建動態(tài)數(shù)組實例
- ASP定義數(shù)組方法的技巧
相關(guān)文章
在VBScript中實現(xiàn)-函數(shù)/方法名作為參數(shù)傳入另一個函數(shù)
在VBScript中實現(xiàn)-函數(shù)/方法名作為參數(shù)傳入另一個函數(shù)...2007-08-08