469,285 Members | 2,524 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,285 developers. It's quick & easy.

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 9107
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 CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.