home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 1999 April / APC443.iso / features / grpware / coldfus / coldfusi.exe / data1.cab / Documentation / snippets / arraymin.cfm < prev    next >
Encoding:
Text File  |  1998-10-08  |  965 b   |  42 lines

  1. <!--- This view-only example shows the use of ArrayMax and ArrayMin --->
  2. <HTML>
  3. <HEAD>
  4. <TITLE>ArrayMin Example</TITLE>
  5. </HEAD>
  6.  
  7. <BODY>
  8. <H3>ArrayMin Example</H3>
  9. <P>
  10. This view-only example uses ArrayMax and ArrayMin
  11. to determine the largest and smallest elements
  12. in an array.
  13. <P>
  14. See the View Example pane to view the code.
  15. <!--- create an array and run a standard search --->
  16. <!---
  17. <CFSET myNumberArray = ArrayNew(1)>
  18.  
  19.  <CFSEARCH NAME="SearchSnippets"
  20.         COLLECTION="snippets"
  21.         TYPE="simple"
  22.         CRITERIA="Array*">
  23. <CFSET temp = 1>
  24. --->
  25. <!--- output the results of the search --->
  26. <!---
  27. <CFOUTPUT QUERY="SearchSnippets">
  28.     <CFSET myNumberArray[temp] = score>
  29.     <CFSET temp = temp + 1>
  30. </CFOUTPUT>
  31. <CFOUTPUT>
  32. The largest numeric element of the
  33. #ArrayLen(myNumberArray)# elements
  34. is #ArrayMax(myNumberArray)#.  The smallest element
  35. is #ArrayMin(myNumberArray)#.
  36. </CFOUTPUT>
  37. --->
  38.  
  39. </BODY>
  40. </HTML>       
  41.      
  42.