[thelist] CFswitch doesn't.

Frank lists at frankmarion.com
Fri Aug 12 17:55:15 CDT 2005


At 05:48 PM 2005-08-12, you wrote:
Hmmm. Me English no so good speak, it today seems.

Once again.
I have two case statements. Each should include one document, based on 
the  value for the variable "fuseaction".  As it stands, a document is 
included for EACH Case statement, regardless of which of the two CASE 
statements are chosen; that is, whether I choose the value "home" or 
"about" both documents are included. If I use another value for the 
variable "fuseaction" neither display. The presence of the default: {} 
statement seems to make no difference.

Can anyone see what I might be missing?


>The following code is a simple switch/case statement. Ideally, when the 
>variable fuseaction  EQ anything but "contact" or "about", nothing should 
>no document should be included. In this case, both are included regardless 
>of the value of the variable "fuseaction".
>
>Can anyone see what I might be missing?
>
><!--- Include UDF's (Both UDF's from CFLIB.org) --->
>    <cfinclude template="../udf/include.cfc">
>    <cfinclude template="../udf/cfparam.cfc">
>
><!--- Switch among various fuses --->
>    <cfscript>
>       cfparam ("fuseaction", "");
>       switch(fuseaction) {
>          case "about": {
>             include("../pages/dsp_about.cfm");
>          }
>          case "contact":  {
>             include("../pages/dsp_contact.cfm");
>          }
>          default: {}
>          break;
>       }
>    </cfscript>


Frank Marion     lists at frankmarion.com      Keep the signal high.





More information about the thelist mailing list