<cfscript> switch(fuse) { case "login": { ArrayAppend(IncludeArray,"DisplayFiles\dsp_Login.cfm"); break; } case "logout": { include("ActionFiles\act_logout.cfm"); relocate("index.cfm?fuse=login&message=You have been successfully logged out."); break; }
I have a large controller (2500 lines or so) file that makes a lot of object calls within my switch statements and when using switch and case statements within cfscript I would get a "Invalid method Code length" error. Once I converted the switch statements to markup everything worked fine...
<cfswitch expression="#fuse#"> <cfcase value= "login"> <cfscript> ArrayAppend(IncludeArray,"DisplayFiles\dsp_Login.cfm"); </cfscript> </cfcase> <cfcase value= "logout"> <cfscript> include("ActionFiles\act_logout.cfm"); relocate("index.cfm?fuse=login&message=You have been successfully logged out."); </cfscript> </cfcase>