| Contents > CFML Reference > ColdFusion Functions > ArrayMin |
|
|
|
|
||
Array minimum function.
The smallest numeric value in an array. If the array parameter value is an empty array, returns zero.
ArrayMin(array)
Parameter |
Description |
|---|---|
array |
Name of an array |
<h3>ArrayMin Example</h3> <p>This example uses ArrayMin to find the smallest number in an array.<br></p> <!--- After checking whether the form has been submitted, this code creates an
array and assigns the form fields to the first two elements. -----> <cfif IsDefined("FORM.submit")> <cfset myNumberArray = ArrayNew(1)> <cfset myNumberArray[1] = FORM.number1> <cfset myNumberArray[2] = FORM.number2> <cfif Form.Submit is "Minimum Value"> <!--- use ArrayMin to find the smallest number in the array ---> <p>The smallest number that you entered is <cfoutput>#ArrayMin(myNumberArray)#.</cfoutput> </cfif> </cfif> <!---- The following form provides two numeric fields that are compared when the
form is submitted. -----> <form action = "arraymin.cfm"> <input type = "hidden" name = "number1_Float"> <input type = "hidden" name = "number2_Float"> <input type = "text" name = "number1"><br> <input type = "text" name = "number2"><br> <input type = "submit" name = "submit" value = "Minimum Value"> </form>
|
|
||
| Contents > CFML Reference > ColdFusion Functions > ArrayMin |
|
|
ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting
Version 6.1
Comments are no longer accepted for ColdFusion MX 6.1. ColdFusion 8 is the current version.
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functa11.htm