Asp在任意几个数字中求最大值与最小值函数

<% Function   Max(Price) 

Dim   n,  m 

If   UBound(Price)   >   0   Then 

m   =   Price(0) 

For   n   =   1   To   UBound(Price) 

If   Price(n)   >   m   Then   m   =   Price(n) 

Next 

Max   =   m 

Else 

Max   =   Null 

End   If 

End   Function

Function   Min(Price) 

Dim   n,  m 

If   UBound(Price)   >   0   Then 

m   =   Price(0) 

For   n   =   1   To   UBound(Price) 

If   Price(n)   <   m   Then   m   =   Price(n) 

Next 

Min   =   m 

Else 

Min   =   Null 

End   If 

End   Function 

Dim   ary 

ary   =   Array(12,13,41,61,8,38,90) 

Response.Write   Max(ary) 

Response.Write   " <BR><BR> " 

Response.Write   Min(ary) %>

相关文章

数组的定义 Dim MyArray MyArray = Array(1‚5‚123‚12‚98...
\'参数: \'code:要检测的代码 \'leixing:html或者ubb \'n...
演示效果: 代码下载: 点击下载
环境:winxp sp2 ,mysql5.0.18,mysql odbc 3.51 driver 表采...
其实说起AJAX的初级应用是非常简单的,通俗的说就是客户端(j...
<% ’判断文件名是否合法 Function isFilename(aFilename...