home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 February / CHIPCD_02_2002.iso / Internet / Macromedia ColdFusion Server 5 / coldfusion-50-win-us.exe / data1.cab / Examples / CFDOCS / snippets / min.cfm < prev    next >
Encoding:
Text File  |  2001-06-13  |  879 b   |  43 lines

  1. <!--- This example shows the Max and Min
  2. of two numbers --->
  3. <HTML>
  4.  
  5. <HEAD>
  6. <TITLE>
  7. Min Example
  8. </TITLE>
  9. </HEAD>
  10.  
  11. <BASEFONT FACE="Arial, Helvetica" SIZE=2>
  12. <BODY  bgcolor="#FFFFD5">
  13.  
  14. <H3>Min Example</H3>
  15. <CFIF IsDefined("form.myNum1")>
  16.  
  17.     <CFIF IsNumeric(form.myNum1) and IsNumeric(form.myNum2)>
  18.     <P>The maximum of the two numbers is <CFOUTPUT>#Max(form.myNum1, form.myNum2)#</CFOUTPUT>    
  19.     <P>The minimum of the two numbers is <CFOUTPUT>#Min(form.myNum1, form.myNum2)#</CFOUTPUT>    
  20.  
  21.     <CFELSE>
  22.     <P>Please enter two numbers
  23.     </CFIF>
  24.  
  25.  
  26.  
  27. </CFIF>
  28.  
  29.  
  30. <FORM ACTION="min.cfm" METHOD="POST">
  31. <H3>Enter two numbers, and see the maximum
  32. and minimum of the two numbers</H3>
  33.  
  34. Number 1 <INPUT TYPE="Text" NAME="MyNum1">
  35. <BR>Number 2 <INPUT TYPE="Text" NAME="MyNum2">
  36.  
  37. <BR><INPUT TYPE="Submit" NAME="" VALUE="See results">
  38. </FORM>
  39.  
  40. </BODY>
  41.  
  42. </HTML>       
  43.