home *** CD-ROM | disk | FTP | other *** search
/ PC User 2001 August / APC_Aug2001_CD2.iso / features / coldfusn / files / coldfusion-50-win-us.exe / data1.cab / Examples / CFDOCS / snippets / iif.cfm < prev    next >
Encoding:
Text File  |  2001-05-24  |  657 b   |  31 lines

  1. <!--- This example shows IIf --->
  2.  
  3. <HTML>
  4.  
  5. <HEAD>
  6. <TITLE>
  7. IIf Example
  8. </TITLE>
  9. </HEAD>
  10.  
  11. <BASEFONT FACE="Arial, Helvetica" SIZE=2>
  12. <BODY  bgcolor="#FFFFD5">
  13.  
  14. <H3>IIf Function</H3>
  15.  
  16. <P>IIf evaluates a condition, then performs an Evaluate on 
  17. string expression 1 or string expression 2 depending on the 
  18. Boolean outcome <I>(TRUE = run expression 1; FALSE = run
  19. expression 2)</I>.
  20.  
  21. <P>The result of the expression IIf( Hour(Now()) GT 12, DE("It is afternoon or evening"), DE("It is morning"))
  22. is:<BR>
  23. <CFOUTPUT>
  24. #IIf( Hour(Now()) GT 12, DE("It is afternoon or evening"), DE("It is morning"))#
  25. </CFOUTPUT>
  26.  
  27.  
  28. </BODY>
  29.  
  30. </HTML>       
  31.