• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 14. Conditional Logic Problems a... > Using CFSWITCH, CFCASE, and CFDEFAUL...

Using CFSWITCH, CFCASE, and CFDEFAULTCASE

The CFIF tag is useful for conditional execution when the expression evaluates to a true or false value. But what if the expression could evaluate to several possible values? These are very common—you might want to look at possible values of a form field, or the return value of a function that could return several possible values.

Although you could compare the result of the expression to a particular value in a series of CFIF-CFELSEIF tags, CFML provides another flow control mechanism that makes it cleaner and more efficient to execute code conditionally depending on the result of such an expression.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint