How to obtain the maximum value in an array by ASP-application techniques

Source: Internet
Author: User
How to get the maximum value in an array (provided by the 71PORT_80 port)
The function is to obtain a set of the largest array of values, very practical and fine code, worthy of collection!
Copy Code code as follows:


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 "Array" &snum& "<br/> Maximum value:" &getmax (Snum)
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.