發表于:2011-07-05 00:00:00來源:SOUAB.COM人氣:3573
<% 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) %>