CFCASE expects constants for the VALUE attribute. Although you are defining
your 'constants' in your app.cfm, CFCASE still sees them as variables.
Steve
> -----Original Message-----
> From: Michael O Reilly [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, June 27, 2000 14:12
> To: [EMAIL PROTECTED]
> Subject: Constants in CFCase statements
>
>
> Everyone:
>
> Can anyone tell me why the following
>
> <CFSwitch EXPRESSION = '#Session.SecurityLevel#'>
> <CFCase VALUE = 1> <!---SysAdminLev --->
> <cflocation URL="./SysAdmin/SysAdmin.cfm" ADDTOKEN="No">
> </CFCASE>
> <CFCase VALUE = 2> <!--- AdminUserLev --->
> <cflocation URL="./UserAdmin/UserAdmin.cfm" ADDTOKEN="No">
> </CFCASE>
> <CFCase VALUE = 3> <!--- UserLev --->
> <cflocation URL="./Users/MainMenu.cfm" ADDTOKEN="No">
> </CFCASE>
> <!-- Default Case to trap Non logged in users who try this page --->
> <CFDEFAULTCASE>
> <cflocation URL="./Login.htm" ADDTOKEN="No">
> <CFAbort>
> </CFDEFAULTCASE>
> </CFSwitch>
>
>
> works whereas if I define "Constants" in application.cfm e.g.
>
> <CFSET SysAdminLev=1>
>
> and use those as follows
>
> <CFSwitch EXPRESSION = '#Session.SecurityLevel#'>
> <CFCase VALUE = #SysAdminLev#> <!---SysAdminLev --->
> <cflocation URL="./SysAdmin/SysAdmin.cfm" ADDTOKEN="No">
> </CFCASE>
>
> I get an error. BTW this code is within a <CFoutput> </Cfoutput> pair.
>
> Regards
> Michael O'Reilly
> Analyst Programmer
> TransAer
>
>
>
> ------------------------------------------------------------------
> ------------
> Archives: http://www.eGroups.com/list/cf-talk
> To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.