471,616 Members | 1,743 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,616 software developers and data experts.

Max Number in List (Solution)

The delima was I had a list of numbers that I needed to find the maximum value of. Simply doing Max(ListName) did not work because the Max function requires only two parameters.

What I ended up doing to get around this was converting my list to an array and doing the ArrayMax function

<cfset myList = "1,3,1,2,5,2,2,3,2,3,4">
<cfset maxNum = ArrayMax(ListToArray(myList))>

I figured I'd share this since this seemingly small issue took me a good hour to figure out.
Aug 8 '08 #1
1 9480
16,027 Expert Mod 8TB
You can use a mixture of ListSort and ListFirst/ListLast rather than converting to an array.
Aug 8 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by Lapchien | last post: by
20 posts views Thread by William Stacey [MVP] | last post: by
5 posts views Thread by Dr. Pastor | last post: by
15 posts views Thread by getsanjay.sharma | last post: by
1 post views Thread by Susie Weimer | last post: by
1 post views Thread by XIAOLAOHU | last post: by
1 post views Thread by ZEDKYRIE | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.