473,371 Members | 1,461 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Max Number in List (Solution)

76
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 9930
acoder
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

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

Similar topics

5
by: Lapchien | last post by:
I have list of numbers in a table (originally from autonumber in a different database) from 1 to 1,000,000. The list is not in sequential order - there are loads of numbers missing. How can I...
20
by: William Stacey [MVP] | last post by:
int list = {1,2,3,4,5,6}; Function to randomize the list? Cheers! -- William Stacey, MVP
5
by: Dr. Pastor | last post by:
In the following code I would like to ascertain that x has/is a number. What the simplest TEST should be? (Could not find good example yet.) --- x=raw_input('\nType a number from 1 to 20') if...
15
by: getsanjay.sharma | last post by:
Hello there my friends, this is my first attempt at posting in a newsgroup. Here is my problem statement: Me and my friend decided to solve a programming problem with our own styles and then...
4
bartonc
by: bartonc | last post by:
Description: This is a fast prime number list generator using sieve algorithm. This function return a list of prime numbers which <= argument. def primes(n): if n==2: return elif n<2:...
4
by: mustang07 | last post by:
I need this program to find all occurences of a name and display them. If I enter Palmer, I need it to display all the Palmers in the list. Can anyone help me Please. Thank You!! #include...
5
by: cchris | last post by:
Hi, I'm a beginning C student and I'm working on a program that is supposed to display all the prime numbers between 50 and 100. I'm having trouble though. Can anyone help me out. This is what I have...
1
by: ken_wilsonii | last post by:
I ran into this problem it ended up being a combination of this that needed to be done. I believe this will work for a bound list to. The whole problem stems from the two-way binding which has...
1
by: Susie Weimer | last post by:
I have an XML file that has a bulleted list. I would like to have the XSLT change this to an incremented numbered list.
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.