Connecting Tech Pros Worldwide Help | Site Map
Reply
 
LinkBack Thread Tools Search this Thread
  #1  
Old August 8th, 2008, 04:15 PM
Member
 
Join Date: Jul 2006
Location: Virginia Beach, VA
Age: 25
Posts: 57
Default 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.
Reply
  #2  
Old August 8th, 2008, 05:05 PM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 12,961
Default

You can use a mixture of ListSort and ListFirst/ListLast rather than converting to an array.
Reply
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 204,687 network members.
Post your question now . . .
It's fast and it's free

Popular Articles